--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/0078d712-bf40-4f36-a7d7-dd50d8458ed1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Please take a look at https://www.playframework.com/documentation/2.5.x/SettingsLogger#Using-a-Custom-Logging-FrameworkYou need to add a logger-configurator.properties file as a resource:play.logger.configurator=Log4J2LoggerConfiguratorand define the Log4J2LoggerConfigurator class as described in the documentation.Will.
On Sat, Mar 26, 2016 at 11:17 PM, <duluo...@gmail.com> wrote:
I set ".enablePlugins(PlayJava).disablePlugins(PlayLogback)" and
"org.apache.logging.log4j" % "log4j-slf4j-impl" % log4j2Version,
"org.apache.logging.log4j" % "log4j-api" % log4j2Version,
"org.apache.logging.log4j" % "log4j-core" % log4j2Version
then run with " -Dlog4j.configurationFile=conf/log4j2.xml ".
But I got:
No play.logger.configurator found: logging must be configured entirely by the application.
--- (Running the application, auto-reloading is enabled) ---
2016-03-27 14:16:01.671 INFO play.core.server.NettyServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
Server started, use Alt+D to stop
2016-03-27 14:16:02.916 WARN application - Logger configuration in conf files is deprecated and has no effect. Use a logback configuration file instead.
Mar 27, 2016 2:16:03 PM org.mongodb.morphia.logging.MorphiaLoggerFactory chooseLoggerFactory
INFO: LoggerImplFactory set to org.mongodb.morphia.logging.jdk.JDKLoggerFactory
2016-03-27 14:16:04.449 INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started
2016-03-27 14:16:04.505 INFO Remoting - Starting remoting
2016-03-27 14:16:04.610 INFO Remoting - Remoting started; listening on addresses :[akka.tcp://application@192.168.0.152:2551]
2016-03-27 14:16:04.612 INFO Remoting - Remoting now listens on addresses: [akka.tcp://application@192.168.0.152:2551]
javaOptions in run += "-Dlog4j.configurationFile=conf/log4j2.xml"
but get the following via 'sbt run'
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
activator stage
./target/universal/stage/bin/<startscript>fork in run := trueI set ".enablePlugins(PlayJava).disablePlugins(PlayLogback)" and
"org.apache.logging.log4j" % "log4j-slf4j-impl" % log4j2Version,
"org.apache.logging.log4j" % "log4j-api" % log4j2Version,
"org.apache.logging.log4j" % "log4j-core" % log4j2Version
then run with " -Dlog4j.configurationFile=conf/log4j2.xml ".
But I got:
No play.logger.configurator found: logging must be configured entirely by the application.
--- (Running the application, auto-reloading is enabled) ---
2016-03-27 14:16:01.671 INFO play.core.server.NettyServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
Server started, use Alt+D to stop
2016-03-27 14:16:02.916 WARN application - Logger configuration in conf files is deprecated and has no effect. Use a logback configuration file instead.
Mar 27, 2016 2:16:03 PM org.mongodb.morphia.logging.MorphiaLoggerFactory chooseLoggerFactory
INFO: LoggerImplFactory set to org.mongodb.morphia.logging.jdk.JDKLoggerFactory
2016-03-27 14:16:04.449 INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started
2016-03-27 14:16:04.505 INFO Remoting - Starting remoting
2016-03-27 14:16:04.610 INFO Remoting - Remoting started; listening on addresses :[akka.tcp://application@192.168.0.152:2551]
2016-03-27 14:16:04.612 INFO Remoting - Remoting now listens on addresses: [akka.tcp://application@192.168.0.152:2551]
2016-03-27 14:16:04.610 INFO Remoting - Remoting started; listening on addresses :[akka.tcp://appli...@192.168.0.152:2551]
2016-03-27 14:16:04.612 INFO Remoting - Remoting now listens on addresses: [akka.tcp://appli...@192.168.0.152:2551]
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/1ff204b7-57ea-41fa-ac67-bc4e781bb3b4%40googlegroups.com.
2016-03-27 14:16:04.610 INFO Remoting - Remoting started; listening on addresses :[akka.tcp://application@192.168.0.152:2551]
2016-03-27 14:16:04.612 INFO Remoting - Remoting now listens on addresses: [akka.tcp://application@192.168.0.152:2551]
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/72939133-1ac5-41b7-89c1-43e8de34ddce%40googlegroups.com.
I also defined the Log4J2LoggerConfigurator class as described in the
then run with " -Dlog4j.configurationFile=conf/log4j2.xml ".
but for initializing my JDBC Appender, I`ve got following error:
2016-04-25 18:20:34,191 pool-4-thread-2 ERROR java.lang.ClassNotFoundException: com.irisaco.oes.playplugin.logging.biz.ConnectionFactory java.lang.ClassNotFoundException: com.irisaco.oes.playplugin.logging.biz.ConnectionFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:259)
at org.apache.logging.log4j.util.LoaderUtil.loadClass(LoaderUtil.java:122)
at org.apache.logging.log4j.core.util.Loader.loadClass(Loader.java:228)
at org.apache.logging.log4j.core.appender.db.jdbc.FactoryMethodConnectionSource.createConnectionSource(FactoryMethodConnectionSource.java:82)
after tracing the code, It seems that class path of log4j is not the same as my application class path.
My project is attached.
Thanks a lot