Question

I'm trying to setup logging of application on Glassfish server. I use SLF4j to aggregate everything and Logback binding to write the files. Also I added log4j-over-slf4j, jul-to-slf4j and jcl-over-slf4j libraries to the project. Of course slf4j-api and Logback ones are there too. All the libraries are in project WEB-INF/lib and in glassfish/lib/endorsed.

So the idea is: redirect everything to SLF4j and then log with Logback.

In the code I have the following piece for test:

jclLog.debug("Login JCL: Debug level");
jclLog.error("Login JCL: Error level");
log4jLog.debug("Login Log4j: Debug level");
log4jLog.error("Login Log4j: Error level");
slfLog.debug("Login SLF4j: Debug level");
slfLog.error("Login SLF4j: Error level");

After execution there are log entries og Log4j and SLF4j in Logback-configured log files. But JCL entries are not there. They get to server.log file instead.

The question is: why JCL entries are catched with Glassfish logger and how could it be prevented?

Was it helpful?

Solution

You can't (yet) do this. See http://java.net/jira/browse/GLASSFISH-6666 for the relevant bug report.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top