logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Siegel, Bernard J." <bsie...@swri.org>
Subject RE: Problem in viewing the text format log4j file in chainsaw
Date Tue, 09 Oct 2007 22:16:28 GMT
Hi,
You need to use the LogFilePatternReceiver to view text files.
I have this working using a file on the local machine and a file loaded
in a server remotely (mod the fileURL to point out there).
Figuring out the pattern for the log file is the hardest part to get
this working.
You will mod the fileURL, logFormat and timestampFormat entries.
Working samples of configuration, sample log and instructions below.
Hope this helps.

Here is the configuration file you need:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration >
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="true">
<plugin name="XXX LOG FILE"
class="org.apache.log4j.varia.LogFilePatternReceiver">
    <param name="timestampFormat" value="yyyy-MM-dd HH:mm:ss,SSS"/>
    <param name="logFormat" value="* * * PROP(MIDTIERHOST) TIMESTAMP
LEVEL * - Deployed: PROP(DEPLOYEDWEDSERVER) - Logger: LOGGER -
MESSAGE"/>
    <param name="fileURL" value="file:///C:/junk/xxx.log"/>
    <param name="tailing" value="true"/>

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

Here is a small log file (a few lines):
Sep 25 04:06:25 xxxmtdevdl 2007-09-25 04:06:25,592 DEBUG eaq - Deployed:
xxxInteg - Logger: EAQ - Query SQL: SELECT Appointment_Number,
Old_Appt_Number, Request_Number
Sep 25 04:06:25 xxxmtdevdl 2007-09-25 04:06:25,624 DEBUG eaq - Deployed:
xxxInteg - Logger: EAQ - Number of appointments returned: 1 
Sep 25 04:06:25 xxxmtdevdl 2007-09-25 04:06:25,624 DEBUG eaq - Deployed:
xxxInteg - Logger: EAQ - Number of appointments returned: 1 
Sep 25 04:06:25 xxxmtdevdl 2007-09-25 04:06:25,625 DEBUG apptevent -
Deployed: xxxInteg - Logger: APPTEVENT - Results returned for
SCHEDULED,appointment: 6, package: 2164
Sep 25 04:06:25 xxxmtdevdl 2007-09-25 04:06:25,625 DEBUG apptevent -
Deployed: xxxInteg - Logger: APPTEVENT - Results returned for
SCHEDULED,appointment: 6, package: 2164
Sep 25 04:06:25 xxxmtdevdl 2007-09-25 04:06:25,629 ERROR apptevent -
Deployed: xxxInteg - Logger: APPTEVENT - Error processing object event
message. 
Sep 25 04:06:25 xxxmtdevdl 2007-09-25 04:06:25,629 ERROR apptevent -
Deployed: xxxInteg - Logger: APPTEVENT - Error processing object event
message. 
Sep 25 04:06:25 xxxmtdevdl 2007-09-25 04:06:25,629 ERROR apptevent -
Deployed: xxxInteg - Logger: APPTEVENT - xxx-JAVA-9999: xxx-UNAV-0022:
The appropriate ViewX patch for this function may not be installed on
the ViewX server.-- A native Java exception has occurred.  Please check
the log for details. Note: xxx-UNAV-0022: The appropriate ViewX patch
for this function may not be installed on the ViewX server.-- A native
Java exception has occurred. 

Here are the instructions (slightly edited) that I shared with some
co-workers:
Chainsaw is a log viewing GUI utility written by the log4j guys (free!).
Download the WebStart version from here:
http://logging.apache.org/chainsaw/download.html

For XXX, place the attached xxx_log4j.xml (can be renamed) somewhere.
Place the attached xxx.log file (must unzip first) somewhere.
Edit the xxx_log4j.xml file to change "file:///C:/junk/xxx.log" to where
ever you placed the xxx.log file.
Please do not modify the logFormat line - it's format is critical to
it's parsing the log.

Start WebStart, start Chainsaw, click "Ask Later", select "Let me search
for a configuration file", browse to the xxx_log4j.xml file (open),
click OK.
It will start loading the xxx.log - 12MB takes about 2 minutes on my dev
box.
A tab marked "file:///C:/junk/burp/xxx.log" will appear next to the
chainsaw.log tab.

On the right hand Receivers panel, you should see "XXX LOG FILE".
Right click will display the selectable logging levels - click on the
curved arrow above to reload.
This lets you filter on logging level.

On the left hand panel, Root Logger and sub-nodes will appear.  The
magnifier glasses above will allow you to select/suppress various
loggers.  Helps when you want to filter by loggers.

The menu bar selection "Current tab" has many options, including
preferences, etc.
 


Bernard Siegel
Senior Research Analyst
Mobile Systems Technology Group
Presentation Systems Section
Software Design and Development Department
Medical Systems Organization
Software Engineering
Division 10, Automation and Data Systems
Southwest Research Institute
Desk Phone:  (210) 522-2347
Cell Phone: (210) 387-6437
Fax Phone: (210) 522-4228

"They placed me on this earth without a manual. 
 And I dare to say, I'm doing just fine without ;)" 
-----Original Message-----
From: Karishma Bagpatia [mailto:karishma_bagpatia@yahoo.com] 
Sent: Tuesday, October 09, 2007 4:00 PM
To: log4j-user@logging.apache.org
Subject: Problem in viewing the text format log4j file in chainsaw


Hi all,

I am new to chainsaw. I want to use it for text log4j files. I tried
loading the file using reciever file pattern but not able to see them
properly.
I could not find help for the text format.
Can somebody tell me the exact procedure to load the text log4j file and
view the logs in all the modes?

Thanks,
Karishma
--
View this message in context:
http://www.nabble.com/Problem-in-viewing-the-text-format-log4j-file-in-c
hainsaw-tf4596856.html#a13124656
Sent from the Log4j - Users mailing list archive at Nabble.com.


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


Mime
View raw message