You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by rakesh patel <rp...@us.nomura.com> on 2005/12/23 15:32:23 UTC

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


Re: using chainsaw to view log files

Posted by Anders Ekelund <an...@telltales.se>.
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" <an...@telltales.se>
To: "Log4J Users List" <lo...@logging.apache.org>
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" <rp...@us.nomura.com>
To: <lo...@logging.apache.org>
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: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: using chainsaw to view log files

Posted by Anders Ekelund <an...@telltales.se>.
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" <rp...@us.nomura.com>
To: <lo...@logging.apache.org>
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: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
>