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'm facing an issue, where all my request logs (processed thru lograge) have the INFO log_level, so I can't filter errors, warns and infos. Looking into the source code, we see that it calls the logger method here, using the Lograge.log_level class variable:
Well, this other line will define what is in Lograge.log_level. It will either use a configured (and fixed) log_level, or falls back to :info, which is what's happening to me, since I don't have any log_level configured:
My conclusion is that lograge seems to have a fixed log_level, but I need each request log to follow the http status code, otherwise filtering will be harder and non intuitive: it makes no sense to have a 500 error logged as INFO.
We can do a workaround by setting Lograge.log_level to a different level every time a new log is created, but is this the correct way to do it? Does lograge offer a better solution?
Thanks!
The text was updated successfully, but these errors were encountered:
I'm facing an issue, where all my request logs (processed thru lograge) have the INFO log_level, so I can't filter errors, warns and infos. Looking into the source code, we see that it calls the logger method here, using the
Lograge.log_level
class variable:lograge/lib/lograge/log_subscribers/base.rb
Line 26 in 711231e
Well, this other line will define what is in
Lograge.log_level
. It will either use a configured (and fixed) log_level, or falls back to :info, which is what's happening to me, since I don't have any log_level configured:lograge/lib/lograge.rb
Line 190 in 711231e
My conclusion is that lograge seems to have a fixed log_level, but I need each request log to follow the http status code, otherwise filtering will be harder and non intuitive: it makes no sense to have a 500 error logged as INFO.
We can do a workaround by setting
Lograge.log_level
to a different level every time a new log is created, but is this the correct way to do it? Does lograge offer a better solution?Thanks!
The text was updated successfully, but these errors were encountered: