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
Add the error code in the logs #3415
Comments
This breaks the convention of the "Combined Log Format", that we are using, so far. To do such things we should change the log format entirely, for example produce JSON logs or so. |
Are we really complying to http://justsolve.archiveteam.org/wiki/Combined_Log_Format? Right now we're not adding the "Number of bytes transferred in requested object" field.
I wouldn't be opposed to json logs but that seems like another feature. Nginx for example allows configuring its plain text log format: https://docs.nginx.com/nginx/admin-guide/monitoring/logging/#setting-up-the-access-log So maybe we could add a config for this? |
Btw, it shouldn't be hard to implement a json logger. We already have all the logic centralized in Logger.hs, some of the required functions are already there too. We would just need to stop using the Logger.middleware. Maybe we can have a config similar to pg:
Like:
|
Problem
Currently the logs show errors (on log-level=
error
orwarn
) as:When doing:
But the status code on the log line is not enough to identify the error. Considering that 400 is used for various errors (ref)
Solution
Add the error code next to the status code on the logs:
The text was updated successfully, but these errors were encountered: