gunicorn
gunicorn copied to clipboard
LogRecords should not format variables into message
The msg
of logging calls should be format strings and not include variables.
msg – The event description message, possibly a format string with placeholders for variable data.
https://docs.python.org/3/library/logging.html#logrecord-objects
One example is at https://github.com/benoitc/gunicorn/blob/cf55d2cec277f220ebd605989ce78ad1bb553c46/gunicorn/workers/ggevent.py#L113
Pre-formatting variables into the msg
prevents aggregation of logs in tools/services like sentry.
I don't understand how this change is related to the issue. How it is preventing aggregation with sentry?
I don't understand how this change is related to the issue. How it is preventing aggregation with sentry?
Sentry treats each error as a separate issue since it has a different message.
+1 on this issue, I also experience it.
Sentry treats each error as a separate issue since it has a different message.
Exactly that.
Yes. This would make investigating Gunicorn timeouts for everyone that uses Sentry way easier.
A patch for it would be accepted.
here is my pr: https://github.com/benoitc/gunicorn/pull/2802
I missed that sorry. Committed. Thanks!