Logging per Deployment - JBoss EAP 6.1.0 Final - Bug - Server.out and Server.err messages lost
ptjb May 30, 2013 9:28 PMWith JBoss EAP 6.1.0 Final, when using logging per deployment, the Server.out and Server.err messages are lost.
I have attached a example project, witht he following readme.txt
Is this a bug?
Also, is the expected result fully correct?
About
----
This project is a simple attempt to:
1. Utilise JBoss per deployment logging
2. Have a log4j.xml file in project to specify appenders and patterns.
3. Log out via JUL, SLF4J, Log4j, Commons Logging
4. Log out via ServletContext.log().
5. Log out via System.out and System.err.
What does not work:
1. Log out via System.out. This log message is lost.
2. Log out via System.err. This log message is lost.
(i.e. see documentation for jboss 7.2 https://docs.jboss.org/author/display/AS72/Logging+Configuration)
Test Case
---------
Steps to reproduce
1. Start server (JBoss EAP 6.1.0 Final)
2. Deploy (mvn clean package jboss-as:deploy)
3. Navigate to http://localhost:8080/test-logging-per-deployment
Expected Result
Three messages in ${jboss.server.log.dir}/server.log for:
"Message 5. Message from getServletContext().log()"
"Message 6. Message from System.out"
"Message 7. Message from System.err"
Four messages in ${jboss.server.log.dir}/application-log.log for:
"Message 1. Log4J logger"
"Message 2. Commons Logger"
"Message 3. slf4j logger"
"Message 4. java util logging"
Actual Result
Two lost messages for:
"Message 6. Message from System.out"
"Message 7. Message from System.err"
One messages in ${jboss.server.log.dir}/server.log for:
"Message 5. Message from getServletContext().log()"
Four messages in ${jboss.server.log.dir}/application-log.log for:
"Message 1. Log4J logger"
"Message 2. Commons Logger"
"Message 3. slf4j logger"
"Message 4. java util logging"
Notes about test case
The logging subsystem should detect the log4j.xml file and trigger logging per deployment.
Make sure logging per deployment in not turned off.
If all logging appears in the the server.log file and none in the application-log.log file, logging per deployment has failed to activate,
Log4j.xml file needed to be classpath to be detected by logging subsystem, even though the jboss documentation says can be in WEB-INF directory.