logstasher
logstasher copied to clipboard
Default log level
This is a follow up on this issue https://github.com/shadabahmed/logstasher/issues/59
This gem expects a log level to be explicitly provided in the yaml/environment.rb files failing which it assumes the WARN
level as seen here https://github.com/shadabahmed/logstasher/blob/aca28431ae476061739a78cdc9b8a522b0b63eb1/lib/logstasher.rb#L116
Will it better if we fallback to Rails.logger.level
if nothing is specified? I think users would expect LogStasher to use the same severity level as configured for Rails.
I am willing to make this change if it sounds good, or atleast add the current way to documentation because I suspect this is going to be a breaking change
Thank you for posting about this! I have been wondering about this for years (but not enough to actually look deeply into this apparently) and was very confused why the Rails log level was not being respected. I agree that falling back to Rails.logger.level would be a more expected default behavior.
Agree. cc @petergoldstein
@shadabahmed Sure. I agree that's a more sensible default behavior.
For packaging my suggestion would be:
- Determine if there are any other breaking functionality changes that we'd want to make
- Make this change
- Drop support for Rails 5.2 (and possibly Ruby 2.6, which is EOLd in ~2 months)
- Bundle that all as a breaking release.
That'll get this change in, properly signal breaking, and shrink the support matrix for future versions/changes.