You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've had an interesting experience recently with Django and Granian. We have migrated from Gunicorn to Granian, and, suddenly, while testing it in local, we saw environment variables being logged, including things like SECRET_KEY. After investigating it, we figured it was due to the request object being JSON serialized. It appears that, with Gunicorn, the request object isn't serializable, but it seems to be with Granian.
I wonder if, by default, logs should not include complex objects, and instead, do something like repr(obj).
Consider the following code:
I've had an interesting experience recently with Django and Granian. We have migrated from Gunicorn to Granian, and, suddenly, while testing it in local, we saw environment variables being logged, including things like
SECRET_KEY
. After investigating it, we figured it was due to therequest
object being JSON serialized. It appears that, with Gunicorn, therequest
object isn't serializable, but it seems to be with Granian.I wonder if, by default, logs should not include complex objects, and instead, do something like
repr(obj)
.Consider the following code:
This way, if one wants to have those values, they can override the
json_record
method, adding their own logic.What do you think?
The text was updated successfully, but these errors were encountered: