Skip to content
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

proposed changes for Neo4j 4.2 logging #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sarmbruster
Copy link

In the test class I'm using the LogManager being shaded into Neo4j instead of the regular one from Log4j2. Since we no longer depend on non-shaded log4j2 I've removed the dependency in pom.xml

For a unknown reason I wasn't able to read the config in json format using the shaded log manager. Therefore I'm providing a yaml variant of this.

Additionall I've added a sys variable to enable verbose log4j2 tracing.

WIth these changes the test passes.

@nioertel
Copy link
Owner

Thanks Stefan.

This workaround may be applicable in certain scenarios but it's not a general solution (specifically also not in my case). It doesn't work for the following scenarios:

  • There is code that's independent from Neo4j and uses Log4j2 API (here we cannot switch from org.apache.logging.log4j.LogManager to org.neo4j.logging.shaded.log4j.LogManager)
  • There is code using SLF4J API and we want to route it through Log4j2 using log4j-slf4j-impl (org.apache.logging.slf4j.Log4jLoggerFactory directly depends on org.apache.logging.log4j.*)

PS: I deleted the log4j2-test.yaml and it picks up the json file on my side.

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 this pull request may close these issues.

2 participants