promptflow icon indicating copy to clipboard operation
promptflow copied to clipboard

[Feature Request] JSON formatted Logs

Open camilla11 opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. We are exporting logs to datadog, and would like exceptions to show up in a single log line. Via the Datadog guidelines, this requires that logs be output in JSON format https://www.datadoghq.com/blog/python-logging-best-practices/#log-in-json-format. We can configure the format of logs in our custom code but the log format for logs from the promptflow executor or serving app use their own format and re https://github.com/microsoft/promptflow/issues/2852 we can only change format (I'm unsure if we can use this to resemble JSON, especially in exceptions)

Describe the solution you'd like Ability to specify log formatter library for logs. For example https://github.com/madzak/python-json-logger or https://pypi.org/project/JSON-log-formatter/

Describe alternatives you've considered Using the new feature above to resemble JSON Trying to hook into Flask handlers like: @app.errorhandler(400) and @app.errorhandler(Exception) with no luck

Additional context Add any other context or screenshots about the feature request here.

camilla11 avatar May 16 '24 14:05 camilla11

I also have this same issue and would really appreciate this feature.

aaronjolson avatar Aug 02 '24 18:08 aaronjolson