I would like to override this method on application log level : (just remove the ''.join(... , basically it makes it easier to read error logs for me.
class CustomJSONLog(json_logging.JSONLogFormatter):
@classmethod
def format_exception(cls, exc_info):
return traceback.format_exception(*exc_info) if exc_info else ''
But since I am using a fast api app, i only get to override the JSONRequestLogFormatter, so i cant override the non web log. And uvicorn errors go trough the latter.
Is there anything close to json_logging.init_request_instrument(app, custom_non_web_formatter=CustomJSONLog) available ?
I would like to override this method on application log level : (just remove the
''.join(...
, basically it makes it easier to read error logs for me.But since I am using a fast api app, i only get to override the JSONRequestLogFormatter, so i cant override the non web log. And uvicorn errors go trough the latter.
Is there anything close to
json_logging.init_request_instrument(app, custom_non_web_formatter=CustomJSONLog)
available ?