[jboss-user] Why does not log4j's '%L' work in JBoss?

Adam Wang adam.sh.cn at gmail.com
Thu Nov 2 22:05:24 EST 2006


Hi:

         After moved a web application from Tomcat to JBoss, I found that in
DEBUG model there was some problem with the Log4j's conversion character
'L'. here are the details:

*JBoss version: *jboss-4.0.4.GA

*The application's Log4j.xml: *

                            …

                            <param name="ConversionPattern"
value="%d{dd/MM/yyyy HH:mm:ss} %-2p %c:%L - %m%n"/>

                            …

*Code for logging:*

**                    …

                            *import* org.apache.commons.logging.Log;

*import* org.apache.commons.logging.LogFactory;



private static Log _log = LogFactory.getLog(SampleClass.class.getName());

…

_log.debug("Log4j log a DEBUG message");



Then in Tomcat, I can got: 10:17:57,359 DEBUG SampleClass:*18* - Log4j log a
DEBUG message ()

In JBoss it turned to: 10:17:57,359 DEBUG SampleClass:* 84* - Log4j log a
DEBUG message ()



How could the Line NO. turned from 18 to 84, and how to fix this problem? We
need the line NO. to debug this software system.

I'll be very grateful if someone could give me some help, my captain have
order me to go through the JBoss' source code to find out the answer, but it
terrible for me to do like he said.

 Best Regards

Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20061103/2f4d487f/attachment.html 


More information about the jboss-user mailing list