-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Start using slf4j for logging instead of java.util.logging #456
Comments
We log minimally, ideally not at all, and primarily only warnings that do not affect the cache's correctness. The primary time you might observe logging is due to a convenience warning when an Currently Caffeine mirror's Google Guava which uses JUL. It's generally good practice to install the adapters from other loggers to slf4j as a fallback. For example I use logback at work but have log4j, jul, and system out/err redirect to slf4j. The next major version will use JEP-264: Platform Logging API, which avoids the dependency, is backwards compatible by defaulting to JUL, and has a cleaner mechanism for redirecting to slf4j. However that requires Java 9. |
Released in 3.0 |
It's easy to use slf4j as abstraction over concrete logging framework: logback, log4j, java.util.logging. All we need is to add jar on classpath: http://slf4j.org/manual.html
Motivation:
We want to use caffeine in library code, but it is currently not possible to disable logging for caffeine in library layer.
Application not using java.util.logging should to do something [that] (https://stackoverflow.com/questions/6020545/send-redirect-route-java-util-logging-logger-jul-to-logback-using -slf4j) just to disable caffeine logs.
I think it would be simpler with slf4j as logging facade. WDYT ?
The text was updated successfully, but these errors were encountered: