CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 156
feat(logging): add support for System.Logger and deprecate Logging #1648
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
Conversation
baa7c5c
to
465af11
Compare
18fb9e5
to
15c4c27
Compare
BREAKING CHANGE: the default driver logging implementation has been changed from `Logging#none()` to `Logging.systemLogging()`. The logging abstraction has been deprecated in favour of the `System.Logger`. Specifically, this applies to the following: - `org.neo4j.driver.Logging` - `org.neo4j.driver.Logger` - `org.neo4j.driver.Config.ConfigBuilder#withLogging(Logging)` - `org.neo4j.driver.Config#logging()` Once the logging abstraction is deleted, the driver is expected to use the `System.Logger` only.
15c4c27
to
632f64c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works in my test, but while I said I really don't mind for the future JUL or System.logger, do you think it is wise to replace JUL with System.logger as part of the deprecation per default?
It would be good to offer the System.logger variant, but keep the JUL logger as default (since you didn't delete it (and if you would, I wouldn't have approved the PR))
Especially as we stated this including and mentioning even the level
- Provide a logging implementation for the driver to use. Java logging framework {@link java.util.logging} with {@link Level#INFO} is used by default.
- Callers are expected to either implement {@link Logging} interface or provide one of the existing implementations available from static factory
- methods in the {@link Logging} interface.
I don't think it's too hard to construct a scenario in which people are relying on that, and they will see a bit of a surprise, without warning.
In the end, I leave it to your judgement.
Maybe I overthink the switch, but we have seen the oddest issues with changing the logging in the core product, and the issues created in some constellations with bridges, fascade etc being on the class path or not (both variants caused trouble).
@michael-simons, thank you for having a look at this PR! π
The current default is actually no logging ( So, we are not actually changing from JUL to System Logger, we are changing from no logging to System Logger. |
@michael-simons FWIW the System.Logger defaults to JUL if JUL is available (i.e. the logger module hasn't been jlinked out) and that's the only logger available. Otherwise, in production systems most devs would use Logback/Log4j, both of which offer System.Logger implementations. |
BREAKING CHANGE: the default driver logging implementation has been changed from
Logging#none()
toLogging.systemLogging()
.The logging abstraction has been deprecated in favour of the
System.Logger
. Specifically, this applies to the following::org.neo4j.driver.Logging
org.neo4j.driver.Logger
org.neo4j.driver.Config.ConfigBuilder#withLogging(Logging)
org.neo4j.driver.Config#logging()
Once the logging abstraction is deleted, the driver is expected to use the
System.Logger
only.