By the way: I use the webstart version of chainsaw 2 since the binary version had problems finding the LogFilePatternReceiver and I didn't wanna go look for it... ;)

//Anders

----- Original Message ----- From: "Anders Ekelund" <[EMAIL PROTECTED]>
To: "Log4J Users List" <[email protected]>
Sent: Friday, December 23, 2005 3:46 PM
Subject: Re: using chainsaw to view log files


The LogFilePatternReceiver will do just that! The tailing functiononality is also very fast. I think it checks the file every 10 sec's by default. I have just got it to work for me. It was a bit tricky at first but then when i found out that the logging pattern was the problem it was solved easily. The logFormat in the chainsaw.xml (chainsaw config file) must correspond to the ConversionPattern for the logger...

Examples from my setup:

Chainsaw configuration file chainsaw.xml:
-------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration >

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/";
           debug="true">
<plugin name="logFileReceiver" class="org.apache.log4j.varia.LogFilePatternReceiver">
   <param name="fileURL" value="file:///c:/logs/tit_log.log" />
   <param name="timestampFormat" value="yyyy-MM-d HH:mm:ss,SSS"/>
<param name="logFormat" value="TIMESTAMP LEVEL [THREAD] CLASS (FILE:LINE) - MESSAGE"/>
   <param name="name" value="logfileReceiver" />
   <param name="tailing" value="true" />
  </plugin>
           <root>
                       <level value="debug" />
           </root>
</log4j:configuration>
-----------------------------------------------------------------------

Part of my log4j properties file:
-----------------------------------------------------------------------
log4j.rootLogger = DEBUG, appendingLogFile

log4j.appender.appendingLogFile=org.apache.log4j.FileAppender
log4j.appender.appendingLogFile.File=c:/logs/tit_log.log
log4j.appender.appendingLogFile.layout=org.apache.log4j.PatternLayout
log4j.appender.appendingLogFile.layout.ConversionPattern=%d %-5p [%t] %C{2} (%F:%L) - %m%n

-----------------------------------------------------------------------

Hope it helps!

//Anders

----- Original Message ----- From: "rakesh patel" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, December 23, 2005 3:32 PM
Subject: using chainsaw to view log files


i was wondering if chainsaw can be used to view log4j files? i know there is
something call the LogFilePatternReceiver, which - according to the
documentation parses and tails a log file. Will the LogFilePatternReceiver pull in the entire file and then add to the display for each incoming entry into the log file? I want the ablility to see the entire file - if i get to see new log events that would be nice, but the functionality akin to "vi" of the log file
would be sufficient.

Thanks
Rakesh


---------------------------------------------------------------------
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]

Reply via email to