JCL registration in Glassfish via SLF4j

I am trying to set up application logging on a Glassfish server. I am using SLF4j to aggregate everything and log bindings to write files. I also added libraries to the project log4j-over-slf4j

, jul-to-slf4j

and jcl-over-slf4j

. Of course, there is slf4j-api

also Logback. All libraries are in the project WEB-INF/lib

and in glassfish/lib/endorsed

.

So the idea is this: redirect everything to SLF4j and then write the log using Logback.

In the code, I have the following snippet to 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");

      

Once executed, there are log4j and SLF4j log entries in the Loglog-configured log files. But there are no JCL entries. Instead, they receive a server.log file.

Question: Why are JCL entries being caught by Glassfish and how can it be prevented?

+3


source to share


1 answer


You cannot (yet) do this. See http://java.net/jira/browse/GLASSFISH-6666 for a related bug report.



+1


source







All Articles