-
-
Notifications
You must be signed in to change notification settings - Fork 59
How can I customize a JSON request log formatter? #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
u should use init_request_instrument to pass a customized custom formatter for request logging, see the method signature here . I've just updated readme to include new example for web logging https://github.com/bobbui/json-logging-python#26-custom-log-formatter |
Thanks, but the problem is that I need to get an instance of |
@buildpeak After tackle this #68 , I think the better way to customize JSON logging request is something like that |
main.zip |
From this example (https://github.com/bobbui/json-logging-python/blob/master/example/custom_log_format.py), I can easily customize a JSON non-web formatter.
However, it seems not easy to customize a JSON log fomatter dealing with request information. For example, like this:
Because,
request_util
is not passed tologging.Formatter.format
method. Any idea?Thanks
The text was updated successfully, but these errors were encountered: