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 Prashant Patil <pr...@persistent.co.in> on 2010/04/27 11:56:14 UTC

FW: Parsing Log4j log file



Hi,

I want to read the log4j log file in my program and want to search some information from the log file.

If there is any API available for log file parsing/reading, Please let me know.

regards,
Prashant


DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.

RE: FW: Parsing Log4j log file

Posted by Prashant Patil <pr...@persistent.co.in>.
Hi Jacob,



Thanks for very valuable response!



Yes I need to store the information retrieved from the log file to the database.

That's why I couldn't use this tool directly.



Your 1st and 2nd approaches I think could be useful. Will explore it and let you know.



Thanks a lot.





regards,

Prashant





-----Original Message-----
From: Jacob Kjome [mailto:hoju@visi.com]
Sent: Tuesday, April 27, 2010 8:05 PM
To: Log4J Users List
Subject: Re: FW: Parsing Log4j log file



I would either use Chaisaw II [1] or look at the code it uses to read log

files.  It can read XML formatted files as well as regular log files, as long

as you give it the pattern the log was written in.  See the

LogFilePatternReciever [2].  Chainsaw can even read a remote file using the

VFSLogFilePatternReciever [3], so I would suggest using the tool rather than

writing the app yourself unless you have very unique requirements.





[1] http://logging.apache.org/chainsaw/index.html

[2]

http://logging.apache.org/log4j/companions/receivers/apidocs/org/apache/log4j/varia/LogFilePatternReceiver.html

[3]

http://logging.apache.org/chainsaw/apidocs/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.html





Jake





On Tue, 27 Apr 2010 17:57:43 +0530

  Prashant Patil <pr...@persistent.co.in> wrote:

> Hi Douglas,

>

> Thanks for the response.

>

> But the problem with that approach is that there are n number of log files

>already exist. And those are not in XMLLayout.

>

> So This approach wouldn't be useful here.

>

> Please let me know if any other efficient solution for this.

>

> regards,

> Prashant

>

>

> -----Original Message-----

>From: Douglas E Wegscheid [mailto:Douglas_E_Wegscheid@whirlpool.com]

> Sent: Tuesday, April 27, 2010 5:22 PM

> To: Log4J Users List

> Cc: log4j-user@logging.apache.org

> Subject: Re: FW: Parsing Log4j log file

>

> one approach, use the XmlLayout, and then you can use your favorite XML

> parsing API to parse the file.

>

> Douglas E Wegscheid

> Lead Technical Analyst, Whirlpool Corporation

> (269)-923-5278

>

> "A wrong note played hesitatingly is a wrong note. A wrong note played

> with conviction is interpretation."

>

>

>

>

>

> Prashant Patil <pr...@persistent.co.in>

> 04/27/2010 05:56 AM

> Please respond to

> "Log4J Users List" <lo...@logging.apache.org>

>

>

> To

> "log4j-user@logging.apache.org" <lo...@logging.apache.org>

> cc

>

> Subject

>FW: Parsing Log4j log file

>

>

>

>

>

>

>

>

>

> Hi,

>

> I want to read the log4j log file in my program and want to search some

> information from the log file.

>

> If there is any API available for log file parsing/reading, Please let me

> know.

>

> regards,

> Prashant

>

>

> DISCLAIMER

> ==========

> This e-mail may contain privileged and confidential information which is

> the property of Persistent Systems Ltd. It is intended only for the use of

> the individual or entity to which it is addressed. If you are not the

> intended recipient, you are not authorized to read, retain, copy, print,

> distribute or use this message. If you have received this communication in

> error, please notify the sender and delete all copies of this message.

> Persistent Systems Ltd. does not accept any liability for virus infected

> mails.

>

>

> DISCLAIMER

> ==========

> This e-mail may contain privileged and confidential information which is the

>property of Persistent Systems Ltd. It is intended only for the use of the

>individual or entity to which it is addressed. If you are not the intended

>recipient, you are not authorized to read, retain, copy, print, distribute or

>use this message. If you have received this communication in error, please

>notify the sender and delete all copies of this message. Persistent Systems

>Ltd. does not accept any liability for virus infected mails.

>

> ---------------------------------------------------------------------

> 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



DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.

Re: FW: Parsing Log4j log file

Posted by Jacob Kjome <ho...@visi.com>.
I would either use Chaisaw II [1] or look at the code it uses to read log 
files.  It can read XML formatted files as well as regular log files, as long 
as you give it the pattern the log was written in.  See the 
LogFilePatternReciever [2].  Chainsaw can even read a remote file using the 
VFSLogFilePatternReciever [3], so I would suggest using the tool rather than 
writing the app yourself unless you have very unique requirements.


[1] http://logging.apache.org/chainsaw/index.html
[2] 
http://logging.apache.org/log4j/companions/receivers/apidocs/org/apache/log4j/varia/LogFilePatternReceiver.html
[3] 
http://logging.apache.org/chainsaw/apidocs/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.html


Jake


On Tue, 27 Apr 2010 17:57:43 +0530
  Prashant Patil <pr...@persistent.co.in> wrote:
> Hi Douglas,
> 
> Thanks for the response.
> 
> But the problem with that approach is that there are n number of log files 
>already exist. And those are not in XMLLayout.
> 
> So This approach wouldn't be useful here. 
> 
> Please let me know if any other efficient solution for this.
> 
> regards,
> Prashant
> 
> 
> -----Original Message-----
>From: Douglas E Wegscheid [mailto:Douglas_E_Wegscheid@whirlpool.com] 
> Sent: Tuesday, April 27, 2010 5:22 PM
> To: Log4J Users List
> Cc: log4j-user@logging.apache.org
> Subject: Re: FW: Parsing Log4j log file
> 
> one approach, use the XmlLayout, and then you can use your favorite XML 
> parsing API to parse the file.
> 
> Douglas E Wegscheid
> Lead Technical Analyst, Whirlpool Corporation
> (269)-923-5278
> 
> "A wrong note played hesitatingly is a wrong note. A wrong note played 
> with conviction is interpretation."
> 
> 
> 
> 
> 
> Prashant Patil <pr...@persistent.co.in> 
> 04/27/2010 05:56 AM
> Please respond to
> "Log4J Users List" <lo...@logging.apache.org>
> 
> 
> To
> "log4j-user@logging.apache.org" <lo...@logging.apache.org>
> cc
> 
> Subject
>FW: Parsing Log4j log file
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Hi,
> 
> I want to read the log4j log file in my program and want to search some 
> information from the log file.
> 
> If there is any API available for log file parsing/reading, Please let me 
> know.
> 
> regards,
> Prashant
> 
> 
> DISCLAIMER
> ==========
> This e-mail may contain privileged and confidential information which is 
> the property of Persistent Systems Ltd. It is intended only for the use of 
> the individual or entity to which it is addressed. If you are not the 
> intended recipient, you are not authorized to read, retain, copy, print, 
> distribute or use this message. If you have received this communication in 
> error, please notify the sender and delete all copies of this message. 
> Persistent Systems Ltd. does not accept any liability for virus infected 
> mails.
> 
> 
> DISCLAIMER
> ==========
> This e-mail may contain privileged and confidential information which is the 
>property of Persistent Systems Ltd. It is intended only for the use of the 
>individual or entity to which it is addressed. If you are not the intended 
>recipient, you are not authorized to read, retain, copy, print, distribute or 
>use this message. If you have received this communication in error, please 
>notify the sender and delete all copies of this message. Persistent Systems 
>Ltd. does not accept any liability for virus infected mails.
> 
> ---------------------------------------------------------------------
> 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: FW: Parsing Log4j log file

Posted by Prashant Patil <pr...@persistent.co.in>.
Hi Douglas,

Thanks for the response.

But the problem with that approach is that there are n number of log files already exist. And those are not in XMLLayout.

So This approach wouldn't be useful here. 

Please let me know if any other efficient solution for this.

regards,
Prashant


-----Original Message-----
From: Douglas E Wegscheid [mailto:Douglas_E_Wegscheid@whirlpool.com] 
Sent: Tuesday, April 27, 2010 5:22 PM
To: Log4J Users List
Cc: log4j-user@logging.apache.org
Subject: Re: FW: Parsing Log4j log file

one approach, use the XmlLayout, and then you can use your favorite XML 
parsing API to parse the file.

Douglas E Wegscheid
Lead Technical Analyst, Whirlpool Corporation
(269)-923-5278

"A wrong note played hesitatingly is a wrong note. A wrong note played 
with conviction is interpretation."





Prashant Patil <pr...@persistent.co.in> 
04/27/2010 05:56 AM
Please respond to
"Log4J Users List" <lo...@logging.apache.org>


To
"log4j-user@logging.apache.org" <lo...@logging.apache.org>
cc

Subject
FW: Parsing Log4j log file









Hi,

I want to read the log4j log file in my program and want to search some 
information from the log file.

If there is any API available for log file parsing/reading, Please let me 
know.

regards,
Prashant


DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is 
the property of Persistent Systems Ltd. It is intended only for the use of 
the individual or entity to which it is addressed. If you are not the 
intended recipient, you are not authorized to read, retain, copy, print, 
distribute or use this message. If you have received this communication in 
error, please notify the sender and delete all copies of this message. 
Persistent Systems Ltd. does not accept any liability for virus infected 
mails.


DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.

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


Re: FW: Parsing Log4j log file

Posted by Douglas E Wegscheid <Do...@whirlpool.com>.
one approach, use the XmlLayout, and then you can use your favorite XML 
parsing API to parse the file.

Douglas E Wegscheid
Lead Technical Analyst, Whirlpool Corporation
(269)-923-5278

"A wrong note played hesitatingly is a wrong note. A wrong note played 
with conviction is interpretation."





Prashant Patil <pr...@persistent.co.in> 
04/27/2010 05:56 AM
Please respond to
"Log4J Users List" <lo...@logging.apache.org>


To
"log4j-user@logging.apache.org" <lo...@logging.apache.org>
cc

Subject
FW: Parsing Log4j log file









Hi,

I want to read the log4j log file in my program and want to search some 
information from the log file.

If there is any API available for log file parsing/reading, Please let me 
know.

regards,
Prashant


DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is 
the property of Persistent Systems Ltd. It is intended only for the use of 
the individual or entity to which it is addressed. If you are not the 
intended recipient, you are not authorized to read, retain, copy, print, 
distribute or use this message. If you have received this communication in 
error, please notify the sender and delete all copies of this message. 
Persistent Systems Ltd. does not accept any liability for virus infected 
mails.