The Log4Net mailing list is a great source of information about using log4Net, in this forum we collect all the messages in the log4net user list and some selected threads from the developer list.
| Author |
Messages |
|
Ian Dykes
 |
| 10/22/2007 12:18 PM |
|
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]
|
|
|
|
|
Proeller, Ulrich
 |
| 10/22/2007 12:35 PM |
|
Hello Ian,
Besides the genuine UdpAppender and a special TcpAppender, Log4View can also open log files, which are created by log4net's FileAppender and RollingFileAppender using the XmlLayout.
Log4View normally show messages sorted by date but can also sort them by any other criteria.
I would be glad hearing from you if Log4View fits to your requirements.
Mit freundlichen Grüßen / Kind regards
Ulrich Proeller
prosa GmbH
Hartwaldstraße 27
86415 Mering
Fon: +49 (8233) 30510
Fax: +49 (8233) 30502
Mobile: +49 (171) 7190650
Web: www.prosa-gmbh.de
EMail: up@prosa-gmbh.de
prosa Gesellschaft für System und Anwendungsentwicklung mbH
GF: Ulrich Proeller, Ulrike Proeller
AG Augsburg, HRB 17165
Ust.-Id. Nr: DE202375536
|
|
|
|
|
Ian Dykes
 |
| 10/22/2007 12:58 PM |
|
Hello,
Unfortunately we're not using the XmlLayout in our RollingFileAppender. Here's the layout we're using:
<layout type="log4net.Layout.PatternLayout"> <param name="Header" value="---Start of session---
" /> <param name="Footer" value="---End of session---
" /> <param name="ConversionPattern" value="[slf5s.start]%d{DATE}[slf5s.DATE]%n%p[slf5s.PRIORITY]%n%x[slf5s.NDC]%n%t[slf5s.THREAD]%n%c[slf5s.CATEGORY]%n%l[slf5s.LOCATION]%n%m[slf5s.MESSAGE]%n%n" /> </layout>
I know this would be quite difficult to parse, but is Log4View able to read this pattern layout?
Thanks
Ian
Ian Dykes
Software Developer
Esendex Ltd
T: +44 (0)115 852 5762
F: +44 (0)115 852 5757
Esendex: Connect and Communicate
|
|
|
|
|
Proeller, Ulrich
 |
| 10/22/2007 1:39 PM |
|
Hello Ian,
the current version of Log4View can only parse XML formatted messages.
I am thinking about adding a pattern layout parser in the next version, but I'm not sure, if it will parse all kind of patterns flawlessly. There are a lot of conceivable patterns that lead to quite ambiguous log messages where you need a lot of artificial intelligence to infer the meaning of the different parts of a message.
Kind regards
Uli
Mit freundlichen Grüßen / Kind regards
Ulrich Proeller
prosa GmbH
Hartwaldstraße 27
86415 Mering
Fon: +49 (8233) 30510
Fax: +49 (8233) 30502
Mobile: +49 (171) 7190650
Web: www.prosa-gmbh.de
EMail: up@prosa-gmbh.de
prosa Gesellschaft für System und Anwendungsentwicklung mbH
GF: Ulrich Proeller, Ulrike Proeller
AG Augsburg, HRB 17165
Ust.-Id. Nr: DE202375536
|
|
|
|
|
Scott Deboy
 |
| 10/22/2007 4:05 PM |
|
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
|
|
|
|
|
Ian Dykes
 |
| 10/22/2007 4:57 PM |
|
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---
" />
<param name="Footer" value="---End of session---
" /> <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⑪ 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
|
|
|
|
|
Scott Deboy
 |
| 10/22/2007 11:49 PM |
|
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
|
|
|
|
|
|
| You are not authorized to post a reply. |
|
|
|
ActiveForums 3.7
|