Tomcat Logging With Slf4j and Log4j

后端 未结 3 1973
南笙
南笙 2020-12-10 15:21

I\'ve got a web-app deployed to a Tomcat 7 server. My application uses log4j and a file appender. However, not all logging messages

相关标签:
3条回答
  • 2020-12-10 15:35

    It looks like the StateUtils class is using java.util.logging (jul). It stands to reason that other myfaces classes also use jul. Thus, you would probably want to funnel jul logs through SLF4J. Have a look at bridging legacy APIs, in particular the jul-to-slf4j bridge.

    Please see SLF4JBridgeHandler javadocs for usage instructions when installing jul-to-slf4j.

    0 讨论(0)
  • 2020-12-10 15:40

    try including the jcl-over-slf4j as a dependency. myfaces is probably using commons-logging.

    check the slf4j docs: http://www.slf4j.org/legacy.html#jcl-over-slf4j

    0 讨论(0)
  • 2020-12-10 15:40

    Configure your tomcat server according to the steps described at http://adfinmunich.blogspot.de/2012/03/how-to-configure-tomcat-to-use-slf4j.html. This blog entry describes how to replace java.util.logging by slf4j (using log4j behind the facade).

    0 讨论(0)
提交回复
热议问题