You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2006/02/08 21:24:07 UTC

DO NOT REPLY [Bug 38580] New: - Reading log files using Chainsaw

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38580>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38580

           Summary: Reading log files using Chainsaw
           Product: Log4j
           Version: unspecified
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: chainsaw
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: annnk475@yahoo.com


I trying to read a log file that I created from my program using chainsaw V2. 
It appears that every line in the log file is read as message. Chainsaw is not 
able to read based on the layout and display it on the appropriate columns. I 
would like to know how can I use Chainsaw to read .txt file as well as .xml 
log file.

My log4j.properties is

log4j.rootLogger=INFO, CHAINSAW_CLIENT, FILE

log4j.appender.CHAINSAW_CLIENT=org.apache.log4j.net.SocketAppender
log4j.appender.CHAINSAW_CLIENT.RemoteHost=localhost
log4j.appender.CHAINSAW_CLIENT.port=4445

log4j.appender.FILE=org.apache.log4j.FileAppender
log4j.appender.FILE.file=c:/JavaFolder/Output.log
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%d %-5p %c - %m%n  [%t]%x 

I tried to put same pattern in the logFormat propety of the 
LogFilePatternReceiver I created.

My Output.log contains

My State
The most beautiful state
One of the TriSate
State of Liberty
Starting up  MyDbProg ...
There is error  oracle.jdbc.driver.OracleDriver
 End 
in]Atlanta Georgia 2006-02-08 14:38:22,407 INFO  MyDbProg - One of the TriSate
  [main]New York 2006-02-08 14:38:22,407 INFO  MyDbProg - State of Liberty
  [main]New York 2006-02-08 14:38:22,407 INFO  MyDbProg - Starting up  
MyDbProg ...
  [main] 2006-02-08 14:38:22,407 ERROR MyDbProg - There is error  
oracle.jdbc.driver.OracleDriver
  [main] 2006-02-08 14:38:22,423 INFO  MyDbProg -  End 
  [main] 


Any feedback is greatly appreciated.

Thanks,
Annie Prasad.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 38580] - Reading log files using Chainsaw

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38580>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38580





------- Additional Comments From sdeboy@iname.com  2006-02-08 22:10 -------
LogFilePatternReceiver doesn't use the 'patterns' used by PatternLayout - it
uses keywords.  

Read the JavaDoc for LogFilePatternReceiver for more information:
http://svn.apache.org/viewcvs.cgi/logging/log4j/trunk/src/java/org/apache/log4j/varia/LogFilePatternReceiver.java?view=markup

There is also a sample receiver configuration available from Chainsaw's
'Welcome' tab - it contains a sample LogFilePatternReceiver configuration section.  

LogFilePatternReceiver can read multiple lines, but I'm not sure it would match
your patternLayout correctly (it would probably match the last line of the text
before the next log message).  

I'd suggest changing your conversionPattern to this:
log4j.appender.FILE.layout.ConversionPattern=%d %p %c [%t] [%x] - %m%n  

And then use this as your logFormat:
TIMESTAMP LEVEL LOGGER [THREAD] [NDC] - MESSAGE

Notice I changed the level to %p - if you truncate the level name in the log
file, Chainsaw won't recognize it.

Scott

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 38580] - Reading log files using Chainsaw

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38580>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38580


sdeboy@iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




------- Additional Comments From sdeboy@iname.com  2006-02-14 17:32 -------
Since this isn't a bug, let's move this conversation to the log4j-user mailing
list.  I'll send an email there.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 38580] - Reading log files using Chainsaw

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38580>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38580





------- Additional Comments From annnk475@yahoo.com  2006-02-14 17:29 -------
Scott, Thanks for the feedback. 

I tried with conversionPattern
log4j.appender.FILE.layout.ConversionPattern=%d %p %c [%t] [%x] - %m%n  
and
logFormat:
TIMESTAMP LEVEL LOGGER [THREAD] [NDC] - MESSAGE

also tried with log4j.xml. But seems to be giving the same output as before. 

Basically I want to know if I can use Chainsaw to filter my log file based on 
NDC.

Thanks in advance.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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