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

[2.5.x] Problem with using custom logger configurator #6017

Closed
el-dom opened this issue Apr 11, 2016 · 2 comments
Closed

[2.5.x] Problem with using custom logger configurator #6017

el-dom opened this issue Apr 11, 2016 · 2 comments

Comments

@el-dom
Copy link
Contributor

el-dom commented Apr 11, 2016

Play Version (2.5.x / etc)

2.5.1

API (Scala / Java / Neither / Both)

Scala 2.11.8

Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)

Ubuntu 14.04 (Production Environment)
Linux W540 4.4.6-1-MANJARO #1 SMP PREEMPT Sat Mar 19 06:00:37 CET 2016 x86_64 GNU/Linux (Development Environment)

JDK (Oracle 1.8.0_72, OpenJDK 1.8.x, Azul Zing)

java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)

Library Dependencies

"org.apache.logging.log4j" % "log4j-slf4j-impl" % "2.4.1",
"org.apache.logging.log4j" % "log4j-api" % "2.4.1",
"org.apache.logging.log4j" % "log4j-core" % "2.4.1"

Expected Behavior

Trying to use a custom logging framework as described in Play documentation
When following the documentation and adding a custom LoggerConfigurator via logger-configurator.properties, the configured LoggerConfigurator should be called.

Actual Behavior

The custom LoggerConfigurator gets never called, because the ClassLoader cannot find any logger-configurator.properties in the classpath.

Reproducible Test Case

Clone @wsargent 's example project from https://github.com/wsargent/play-2.5-log4j2, set a debugging breakpoint at https://github.com/playframework/playframework/blob/58a150d/framework/src/play/src/main/scala/play/api/LoggerConfigurator.scala#L61 and start the project. classLoader.getResourceAsStream("logger-configurator.properties") returns null and thus findFromResources returns None.
Note: Will Sargent's example project uses play 2.5.0, but after unsuccessfully trying 2.5.0 we bumped it to 2.5.1 without noticing any difference. It appears to be exactly what the documentation describes, but we just cannot make it work.

@el-dom
Copy link
Contributor Author

el-dom commented Apr 11, 2016

I'm closing this since it works if the properties file gets placed in the conf folder. Since the documentation just talks about the classpath as the proper location for the properties file, this is fine. Still wondering why the location used by @wsargent won't work though.

@el-dom el-dom closed this as completed Apr 11, 2016
@wsargent
Copy link
Member

@el-dom I don't know why it didn't work for you, but I've moved logger-configurator.properties and added this bug so that if it happens for anyone else it should be added here.

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

No branches or pull requests

2 participants