I was able to convert the events below with the included configuration.

Jul 2, 2008 11:40:10 AM <<fully-qualified-class-name>> <clinit> INFO: Setting 
debug level to INFO
Jul 2, 2008 11:40:10 AM <<fully-qualified-class-name>> addDefaultProperty 
WARNING: nas.nfdc.ascii.basedir default already set by: <<file-with-path>> 
which probably means it's being defined twice, which isbad!!

---------------
config:

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/";
debug="true">
  <plugin name="fileReceiver" 
class="org.apache.log4j.varia.LogFilePatternReceiver">
  <param name="fileURL" value="file:/fakeevents.log"/>
  <param name="timestampFormat" value="MMM d, yyyy h:mm:ss a"/>
  <param name="logFormat" value="TIMESTAMP CLASS * LEVEL: MESSAGE"/>
  <param name="name" value="testLog"/>
  <param name="tailing" value="true"/>
  </plugin>

  <root>
  <level value="debug"/>
  </root>
</log4j:configuration>


A few things to keep in mind: 
 - logFilePatternReceiver's timestamp format relies on SimpleDateFormat patterns
 - the pattern in the configuration assumes 1-hour times appear as single 
digits (8, not 08 for the hour)
 - any character you put in your timestamp format or log format HAS to exist in 
your log file (spaces and delimiters)
 - chainsaw doesn't recognize 'WARNING' severity (it recognizes 'WARN') - it'll 
show up as DEBUG in the logs
 - newlines can be used in log message text


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



-----Original Message-----
From: Shriver, Daniel [mailto:[EMAIL PROTECTED]
Sent: Wed 7/2/2008 8:18 AM
To: Log4J Users List
Subject: FillePatternReciever
 
I'm looking at local documentation for LogFilePatternReciever and am
still confused on configuring it.

I have a log file with lines like:

  Jul 2, 2008 11:40:10 AM <<fully-qualified-class-name>> <clinit> INFO:
Setting debug level to INFO
  Jul 2, 2008 11:40:10 AM <<fully-qualified-class-name>>
addDefaultProperty
  WARNING: nas.nfdc.ascii.basedir default already set by:
<<file-with-path>> which probably means it's being
    defined twice, which isbad!!

(I've blanked out fully-qualified-class-name and file-with-path, just
to make sure I'm not releasing anything I'm not supposed to)

So I have a receiver config:

  <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/";
debug="true">
  <plugin name="fileReceiver"
class="org.apache.log4j.varia.LogFilePatternReceiver">
  <param name="fileURL" value="file:/devel/scengen/dshriver/ATMM.log"/>
  <param name="timestampFormat" value="mmm dd, yyyy II:MM:SS p"/>
  <param name="logFormat" value="TIMESTAMP CLASS * LEVEL: MESSAGE"/>
  <param name="name" value="testLog"/>
  <param name="tailing" value="true"/>
  </plugin>

  <root>
  <level value="debug"/>
  </root>
  </log4j:configuration>

When I ask chainsaw to load this file a dialog pops up saying "Loaded 0
events." (even though the file pointed to in the config file by fileURL
has multiple lines in it (the two at top are some example lines from
it)).

I suspect my timestampFormat is off, I've tried tweaking it several
times (modeling it after 'C's time notation) but still get nothing
loaded in by chainsaw.


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