(responding to http://issues.apache.org/bugzilla/show_bug.cgi?id=38580) - trying to use LogFilePatternReceiver with Chainsaw V2:
Yes, you can use Chainsaw to filter a log file based on NDC. There are two steps: - configure Chainsaw to use a LogFilePatternReceiver (events in the log file end up in the Chainsaw UI) - use the expression syntax to filter entries based on NDC value If you are using a FileAppender with a ConversionPattern: %d %p %c [%t] [%x] - %m%n You should be able to use a LogFilePatternReceiver with a logFormat: TIMESTAMP LEVEL CLASS [THREAD] [NDC] - MESSAGE Ensure the spaces between fields in the conversion pattern match the spaces in the logFormat. Here's an example Chainsaw configuration that should work. Launch Chainsaw, select the View-show application wide preferences menu, and in the 'configuration URL' field at the bottom of the window, provide the URL to your chainsaw configuration xml file, for example: file:///c:/chainsaw.xml Here's an example chainsaw.xml that should work (fix the path and filename in the fileURL). <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration > <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true"> <plugin name="LOGFILE" class="org.apache.log4j.varia.LogFilePatternReceiver"> <param name="fileURL" value="file:///c:/some.log"/> <param name="timestampFormat" value="yyyy-MM-dd HH:mm:ss,SSS"/> <param name="logFormat" value="TIMESTAMP LEVEL CLASS [THREAD] [NDC] - MESSAGE"/> <param name="name" value="my log file"/> <param name="tailing" value="true"/> </plugin> <root> <level value="DEBUG"/> </root> </log4j:configuration> Hope this helps, Scott ------- Additional Comments From [EMAIL PROTECTED] 2006-02-14 17:29 ------- Scott, Thanks for the feedback. I tried with conversionPattern log4j.appender.FILE.layout.ConversionPattern=%d %p %c [%t] [%x] - %m%n and logFormat: TIMESTAMP LEVEL LOGGER [THREAD] [NDC] - MESSAGE also tried with log4j.xml. But seems to be giving the same output as before. Basically I want to know if I can use Chainsaw to filter my log file based on NDC. Thanks in advance. Scott Deboy COMOTIV SYSTEMS 111 SW Columbia Street Ste. 950 Portland, OR 97201 Telephone: 503.224.7496 Cell: 503.997.1367 Fax: 503.222.0185 [EMAIL PROTECTED] www.comotivsystems.com
