Thanks paul -----Original Message----- From: Paul Vaillancourt [mailto:[EMAIL PROTECTED] Sent: Thursday, October 06, 2005 11:19 AM To: Log4J Users List Subject: Re: Log4j1.1.12 and TRACE level
This is a known bug; see below... -------- Original Message -------- Subject: RE: TRACE location information using PatternLayout (Log4j 1.2.12) Date: Mon, 26 Sep 2005 19:11:36 +0100 From: Andy McBride <[EMAIL PROTECTED]> Reply-To: Log4J Users List <[email protected]>, <[EMAIL PROTECTED]> To: 'Log4J Users List' <[email protected]> Hi, I raised this bug on Saturday: http://issues.apache.org/bugzilla/show_bug.cgi?id=36800 Regards Andy > -----Original Message----- > From: Paul Vaillancourt [mailto:[EMAIL PROTECTED] > Sent: 26 September 2005 19:19 > To: Log4j Mailing List > Subject: TRACE location information using PatternLayout (Log4j 1.2.12) > > Hi All, > > I'm trying to print out the location information (via the %l conversion > character) of the newly implemented TRACE level using PatternLayout > but for some reason when I try to output the location, nothing shows up. > I tried to put the information together myself by using %c (category), > %L (line number) and %M (method name) but %c is the only one that works; > the others print out the '?' character. > > Here's my xml block that tries to print out this information. > > <appender name="TRACE_ONLY" class="org.apache.log4j.ConsoleAppender"> > <layout class="org.apache.log4j.PatternLayout"> > <param name="ConversionPattern" value="%l %c %L %M - %m"/> > </layout> > <filter class="org.apache.log4j.varia.LevelMatchFilter"> > <param name="LevelToMatch" value="trace" /> > <param name="AcceptOnMatch" value="true" /> > </filter> > <filter class="org.apache.log4j.varia.DenyAllFilter"/> > </appender> > > The only thing that is printed out here is the category (%c) and the > message (%m). > E.g. package.name ? ? - Test message. > Notice that %l doesn't even print out the '?' character, unlike %L and %M. > If I change the level to DEBUG, everything works fine. > > Any ideas? > > TIA, > Paul V > > Harp, George wrote: > I just downloaded 1.2.12 and tried to use TRACE level. It printed out > but I got a ? mark in both the method name and class name parts of my > pattern layout. > > So C and M. > > my entire Log4j.xml file is: > > > <?xml version="1.0" encoding="UTF-8" ?> > > <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> > > <!-- Make debug="true" attribute for parsing information --> > > <log4j:configuration debug="null" > xmlns:log4j="http://jakarta.apache.org/log4j/"> > > <appender name="Console" class="org.apache.log4j.ConsoleAppender"> > > <layout class="org.apache.log4j.PatternLayout"> > > <param name="ConversionPattern" > > value="%d{dd-MM-yyyy HH:mm:ss} %p %C{1} %M %m%n"/> > > </layout> > > </appender> > > <appender name="LogFile" class="org.apache.log4j.FileAppender"> > > <param name="File" > > value="BatchLogFile.log"/> > > <param name="Threshold" > > value="TRACE"/> > > <param name="Append" > > value="false"/> > > <layout class="org.apache.log4j.PatternLayout"> > > <param name="ConversionPattern" > > value="%d{dd-MM-yyyy HH:mm:ss} %-9.9p %-19.19C{1} %-19.19M %m%n"/> > > </layout> > > </appender> > > <!-- uncomment this out to get debug for 1 class or package > > just change the name element > > <logger > name="net.gainsystems.log4j.GainsBatchLog4jHeaderFileAppender"> > > <level value="DEBUG" /> > > </logger> > > --> > > <root> > > <level value="TRACE"/> > > <appender-ref ref="Console"/> > > <appender-ref ref="LogFile"/> > > </root> > > </log4j:configuration> > > > > Is this a known issue are there work arounds? Did i mess up the setup? > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
