You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2006/08/15 17:30:34 UTC

DO NOT REPLY [Bug 40255] New: - TRACE level does not allow to retrieve the code line number

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: fdeangeli@gmail.com


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 (fda@ast.cam.ac.uk)
 * @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: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 40255] - TRACE level does not allow to retrieve the code line number

Posted by bu...@apache.org.
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


carnold@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME




------- Additional Comments From carnold@apache.org  2006-08-30 21:24 -------
I could not reproduce it with the SVN version.  This seems similar to a previously reported bug, but I 
thought we had fixed it before TRACE ever got into a release.  If not, then I thought we had fixed it in 
1.2.13.

-- 
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: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org