logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Deboy" <sde...@comotivsystems.com>
Subject RE: Application to view output from a RollingFileAppender
Date Mon, 22 Oct 2007 21:49:34 GMT
LogFilePatternReceiver can preserve all lines of a -message- field which
contains newlines, but doesn't support newline as a delimiter in parsing
a single log entry.

If you were to convert your %n's (except at the end of each entry) to
dashes or something else, you could use something like:

TIMESTAMP - LEVEL - NDC - THREAD - LOGGER - PROP(LOCATION) - MESSAGE

I used PROP(LOCATION) above to cause the location field to be written as
a custom 'property' in the Chainsaw UI (represented as a new column),
since I'm not sure what format is rendered by the %l conversion pattern.


If the format of 'location' looked like this:

myfilename:mymethod(somelinenumber)

You could substitute PROP(LOCATION) for something like:

FILE:METHOD(LINE)

Hope this helps -


Scott

-----Original Message-----
From: Ian Dykes [mailto:ian.dykes@esendex.com] 
Sent: Monday, October 22, 2007 7:57 AM
To: Log4NET User
Subject: RE: Application to view output from a RollingFileAppender

Hi Scott,

I didn't know Chainsaw could parse log files, so thanks for that.  I'm
giving it a go now, but the conversion pattern is a little complex:

<layout type="log4net.Layout.PatternLayout">    
     <param name="Header" value="---Start of session---&#xD;&#xA;" />

     <param name="Footer" value="---End of session---&#xD;&#xA;" />     
     <param name="ConversionPattern"
value="[slf5s.start]%d{DATE}[slf5s.DATE]%n%p[slf5s.PRIORITY]%n%x[slf5s.N
DC]%n%t[slf5s.THREAD]%n%c[slf5s.CATEGORY]%n%l[slf5s.LOCATION]%n%m[slf5s.
MESSAGE]%n%n" />
    </layout>

Here's an example of an entry in the log file using this pattern:

[slf5s.start]22 Oct 2007 10:39:38,387[slf5s.DATE]
DEBUG[slf5s.PRIORITY]
(null)[slf5s.NDC]
14[slf5s.THREAD]
com.esendex.net.smpp.pdu.PDU[slf5s.CATEGORY]
com.esendex.net.smpp.pdu.PDU.Serialize(:0)[slf5s.LOCATION]
>> PDU Body   38643300 [SubmitSMResponsePDU][slf5s.MESSAGE]

I'm looking at the Javadocs here:
http://logging.apache.org/log4j/companions/receivers/apidocs/org/apache/
log4j/varia/LogFilePatternReceiver.html, and I can't see how to specify
that the log entry is on multiple lines, so I get a lot of entries in
the Chainsaw trace say "found non-matching line".

I've tried ignoring characters, but I'm not clear on how exactly to do
this.  I know I need to specify a delimiter character but as you can see
the message itself has square brackets in, and these will form part of
the delimiter in some places.

Could you let me know what format I should use for the Chainsaw
receiver?

Thanks
Ian



Ian Dykes
Software Developer
Esendex Ltd

T: +44 (0)115 852 5762
F: +44 (0)115 852 5757
Email: ian.dykes@esendex.com
Web: www.esendex.com
Blog: http://devproj20.blogspot.com/

Esendex: Connect and Communicate
-----Original Message-----

From: Scott Deboy [mailto:sdeboy@comotivsystems.com] 
Sent: 22 October 2007 15:06
To: Log4NET User
Subject: RE: Application to view output from a RollingFileAppender

Log4j's Chainsaw can parse files written using a RollingFileAppender -
on the Chainsaw side, use a LogFilePatternReceiver (the Welcome tab in
Chainsaw has a 'view example receiver configuration' toolbar button
which contains an example xml configuration).  The JavaDoc for
LogFilePatternReceiver describes how you specify the log format.

If you need help, post your conversion pattern and I'll let you know
what log format to use on the Chainsaw receiver side.


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

sdeboy@comotivsystems.com

www.comotivsystems.com



-----Original Message-----
From: Ian Dykes [mailto:ian.dykes@esendex.com]
Sent: Mon 10/22/2007 3:18 AM
To: log4net-user@logging.apache.org
Subject: Application to view output from a RollingFileAppender
 
Hi all,

Does anyone know of an application that is capable of loading a log file
that has been written to using the RollingFileAppender?  I know there's
the Log4Net Viewer and Chainsaw, but I think these applications just
listen to UDP packets, and I need to examine historical logs in files.

I need a viewer that can display log entries in date order and grouped
by thread ideally.  Does anyone know of an application that can do this?

Thanks
Ian 

Ian Dykes
Software Developer
Esendex Ltd

T: +44 (0)115 852 5762
F: +44 (0)115 852 5757
Email: ian.dykes@esendex.com
Web: www.esendex.com
Blog: http://devproj20.blogspot.com/

Esendex: Connect and Communicate
 
Confidentiality: This e-mail (and any associated files) is intended only
for the use of log4net-user@logging.apache.org and may contain
information that is confidential, subject to copyright or constitutes a
trade secret. If you are not log4net-user@logging.apache.org you are
hereby notified that any disclosure, copying or distribution of this
message, or files associated with this message, is strictly prohibited.
If you have received this message in error, please notify us immediately
by replying to the message and then delete it from your computer.
Messages sent to and from us may be monitored. The views expressed in
this message are those of the author Ian Dykes and do not necessarily
represent the views of Esendex Ltd.
 
Security: This e-mail and any attachments are believed to be free from
any virus but it is the responsibility of the recipient to ensure this
is so. E-mail is not a 100% secure communications medium. We recommend
you observe this when e-mailing us.
 
Esendex Ltd is a limited company registered in the UK, with company
number 04217280 and having its registered office at 32a Stoney Street .
Nottingham . NG1 1LL . United Kingdom.
 
[v1.1 EN]

Mime
View raw message