Skip to content

Logging is being made to unqualified logger names 'Driver' and 'ConnectionPool' #710

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

Closed
GrahamLea opened this issue May 22, 2020 · 3 comments · Fixed by #973
Closed

Logging is being made to unqualified logger names 'Driver' and 'ConnectionPool' #710

GrahamLea opened this issue May 22, 2020 · 3 comments · Fixed by #973

Comments

@GrahamLea
Copy link

Driver version: Java 4.0.0 (and 4.1 branch of this repo)

Expected Behaviour
All logging should be made to qualified logger names, e.g. org.neo4j.driver.Driver and org.neo4j.driver.internal.spi.ConnectionPool

Actual Behaviour
Logging is made to top-level loggers and lacks context for both output and configuration.

Steps to reproduce
See uses in code...

DriverFactory.java:

log = logging.getLog( Driver.class.getSimpleName() );

ConnectionPoolImpl.java:

log = logging.getLog( ConnectionPool.class.getSimpleName() );
@michael-simons
Copy link
Contributor

We agree this would be a good change, however only for the 4.1 driver, as this will be a breaking change for users of the driver that use those names to configure the logging.

If you use the driver from within Spring Boot, we recommend using our starter: https://github.com./neo4j/neo4j-java-driver-spring-boot-starter

It will prefix all unprefixed loggers with org.neo4j.driver. and made them easily configurable through Spring Boots config mechanism (via properties). It will also default to Springs logging mechanism.

@GrahamLea
Copy link
Author

Thanks, Michael. Makes sense to leave it for the next version.

FWIW, I'm using the spring-boot-starter-data-neo4j, which obviously doesn't have the same prefixing behaviour you describe above. My guess would be that adding neo4j-java-driver-spring-boot-starter in as well would cause conflicts, but tell me if that's wrong.

@michael-simons
Copy link
Contributor

neo4j-java-driver-spring-boot-starter is a dedicated module maintained by us to provide the best experience with Bolt, without bringing in OGM or any other data mapping.

having said that: You can actually combine them both. And we even got you covered: https://github.com./neo4j/neo4j-java-driver-spring-boot-starter/tree/master/examples/ogm-integration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants