logstasher icon indicating copy to clipboard operation
logstasher copied to clipboard

Default log level

Open mrahul17 opened this issue 2 years ago • 3 comments

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

mrahul17 avatar Oct 20 '21 05:10 mrahul17

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.

ibrahima avatar Jan 11 '22 04:01 ibrahima

Agree. cc @petergoldstein

shadabahmed avatar Jan 19 '22 17:01 shadabahmed

@shadabahmed Sure. I agree that's a more sensible default behavior.

For packaging my suggestion would be:

  1. Determine if there are any other breaking functionality changes that we'd want to make
  2. Make this change
  3. Drop support for Rails 5.2 (and possibly Ruby 2.6, which is EOLd in ~2 months)
  4. 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.

petergoldstein avatar Jan 19 '22 19:01 petergoldstein