elastic / logstash-devutils

An assortment of tooling/libraries to make Logstash core and plugin development and releasing a bit easier.
Apache License 2.0
18 stars 27 forks source link

Refactor: env variable to resemble LS's #87

Closed kares closed 4 years ago

kares commented 4 years ago

This PR accomplished the possibility to debug plugin logging. By setting LOG_LEVEL env variable we'll be able to change LS's logging levels. This is useful e.g. when having issues on CI, when a plugin consumes exceptions that might not be visible using the default warn level in tests.


it's not exactly the same as LS's LOG_LEVEL but can be used the same way e.g. LOG_LEVEL=debug will do the same as --log.level in LS.

do not think we need backwards compatibility that much here as we're the only consumer but if preferred we could keep LOGGER_LEVEL as well

kares commented 4 years ago

sample usage, for reference (will need a rename if/when this PR gets shipped): https://github.com/logstash-plugins/.ci/pull/18#discussion_r509174335

kares commented 4 years ago

Thanks for the review, I've updated to keep the old env name (ENV['LOGGER_LEVEL']) as welll.