Skip to content

improve correctness for logging config - #2060

Merged
easbar merged 4 commits into
graphhopper:masterfrom
oflebbe:logging-correctness
Jul 6, 2020
Merged

easbar merged 4 commits into
graphhopper:masterfrom
oflebbe:logging-correctness

Conversation

@oflebbe

@oflebbe oflebbe commented Jun 7, 2020

Copy link
Copy Markdown
Contributor
  • While digging into the logging configuration I found out that log4j jar is only needed for testing: (Dropwizard is using Logback , Tools are already defining it for runtime)

  • Dropwizard 2.0.8 is using slf4j 1.7.30 , therefor sl4j-log4j12 should be 1.7.30 as well (as the comment notes)

However, no functionality change is detected:
log4j is still included in the shaded web jar (but I do not understand why)
slf4j works for testing, unchanged, as far as I can see.

I proposing to apply the change regardless for the sake of minimal surprise.

@easbar

easbar commented Jun 8, 2020

Copy link
Copy Markdown
Member

Thanks! The build failed for a reason not related to this PR. Can you send the license agreement? https://github.com/graphhopper/graphhopper/blob/master/CONTRIBUTING.md#license-agreement

@oflebbe

oflebbe commented Jun 8, 2020

Copy link
Copy Markdown
Contributor Author

License Agreement already sent to support@ yesterday.

Comment thread pom.xml Outdated
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<scope>test</scope>

@easbar easbar Jun 9, 2020 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this is the dependencyManagement section. We are already declaring the scope at the places we actually use this dependency, so I think we should leave out the scope here. Actually for sf4j-log4j12 we should do the same?

Comment thread pom.xml
<artifactId>slf4j-log4j12</artifactId>
<!-- make sure this matches the slf4j version in the dropwizard bom -->
<version>1.7.26</version>
<version>1.7.30</version>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its a bit unfortunate the dropwizard BOM does not declare this dependency and there is no way we can access the slf4j.version property from there right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok i did this

@michaz

michaz commented Jun 28, 2020

Copy link
Copy Markdown
Member

Why are we using log4j at all in the tests? Can't we just switch them all over to Dropwizard's implementation?

@easbar

easbar commented Jun 28, 2020 •

Copy link
Copy Markdown
Member

Yes using Logback in the tests as well sounds like a good idea. I guess it just was never adjusted after the dw migration? -> #2078

Comment thread pom.xml
<artifactId>slf4j-log4j12</artifactId>
<!-- make sure this matches the slf4j version in the dropwizard bom -->
<version>1.7.26</version>
<version>1.7.30</version>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok i did this

@easbar
easbar merged commit 8338794 into graphhopper:master Jul 6, 2020
@easbar easbar mentioned this pull request Jul 6, 2020
@karussell karussell added this to the 2.0 milestone Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants