-
-
Notifications
You must be signed in to change notification settings - Fork 990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No-op logger is not a sane default #387
Comments
@ceki Upvote. "No-logger" default is terrible. Let's change the default to "slf4j-simple". My case: I am an author of several open-source libraries. I want to use
And they don't follow this link and don't want to waste mental resources to investigate how to fix this yet another annoying issue. Let's log to console by default! |
@asolntsev After some thinking, I think your proposal could be made to work. However, while some users might appreciate to see logs appearing without effort, some other users might be discomforted to see their previously logless application spewing tons of logs. Anyway, it is a relatively important change that would need some maturing. I very much appreciate your proposal and thank you in the mean time. |
@ceki I understand you concern, and I have a suggestion to solve it. UPD
|
If no SLF4J providers are found, SLF4J defaults to no-op logger, which results in all logs, including errors and exceptions being hidden.
IMO this is not a sane default, a better default would be logging exceptions, errors and warning to
stdout
.stdout
is perfectly fine for development and became a common practice for Docker containers in production.The codebase already has
SimpleLogger
that does this, but when I tried to reference it inslf4j.LoggerFactory
it introduced a circular dependency. Maybe it makes sense to copySimpleLogger
to base package, remove all extra code for configurability/etc, call itFallbackStdoutLogger
and use it by default?The text was updated successfully, but these errors were encountered: