DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=40255>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ· INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=40255 Summary: TRACE level does not allow to retrieve the code line number Product: Log4j Version: 1.2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Other AssignedTo: log4j-dev@logging.apache.org ReportedBy: [EMAIL PROTECTED] When using Logger.trace(), if the log message is appended to a common ConsoleAppender with a layout conversion pattern including the line number, instead of the line number a question mark is written. With a log4j.properties equal to: log4j.rootLogger=ALL, A1 log4j.appender.A1=org.apache.log4j.ConsoleAppender log4j.appender.A1.layout=org.apache.log4j.PatternLayout log4j.appender.A1.layout.ConversionPattern=%-4r %-5p [%t] %37c %3x : %L - %m%n The following test unit shows the problem: import junit.framework.TestCase; import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; /** * * @author Francesca De Angeli ([EMAIL PROTECTED]) * @version $Revision$, $Date$ */ public class LoggerTest extends TestCase { Logger logger = null; public void setUp() { PropertyConfigurator.configure("log4j.properties"); logger = Logger.getLogger(LoggerTest.class); } public void testDummy() { logger.debug("Debug msg"); logger.info("Info msg"); logger.trace("This will not print out the line number"); } } The output is: 2 DEBUG [main] log4jtest.LoggerTest : 28 - Debug msg 13 INFO [main] log4jtest.LoggerTest : 29 - Info msg 15 TRACE [main] log4jtest.LoggerTest : ? - This will not print out the line number Thanks, Francesca -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]