logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Deboy" <sde...@comotivsystems.com>
Subject RE: Regarding Chainsaw
Date Tue, 08 Mar 2005 05:28:39 GMT
The 'logFormat' param for a logFilePatternReceiver processsing this log file would be:
LEVEL - [PROP(CurrentTime)] LOGGER - MESSAGE

It seems that some application-specific identifier (userID, etc) would be more useful than
a timestamp if it's possible.

See the example log4j configuration file (available from Chainsaw's Welcome tab) for an example
receiver config.  

Once you have the events in Chainsaw, you can display only events with a specific 'CurrentTime'
property by using this expression in the 'refine focus' field:

PROP.CurrentTime == '2/8/2005 10:28:13'

Scott

-----Original Message-----
From:	Ravishankar, Narayanan Nair [mailto:ravishankar@crimsonlogic.com]
Sent:	Mon 3/7/2005 9:14 PM
To:	Log4J Users List
Cc:	
Subject:	RE: Regarding Chainsaw
Hi Scott,

The logFormat conversion pattern in the log4j propoerties file is

%-5p - [%X{CurrentTime}]%c - %m%n

Thanks and regards,
Ravi


-----Original Message-----
From: Scott Deboy [mailto:sdeboy@comotivsystems.com] 
Sent: Tuesday, March 08, 2005 11:39 AM
To: Log4J Users List
Subject: RE: Regarding Chainsaw


Glad you like it!

Could you provide your current logFormat param from your
LogFilePatternReceiver configuration?

Here is my guess at what your logFormat is:

TIMESTAMP LEVEL - [PROP(SOMEPROPNAME)] LOGGER - MESSAGE
(I'm not sure if the last part are (separated by | ) are properties or
just the log event message.

SOMEPROPNAME is what I'm calling the property (MDC entry) you're
interested in seeing uniquely.

You have two options:
----------------------------------
Use the logger tree:

The logger tree would be a natural way to display these unique entries.


To use the MDC entry in the logger tree, change your logFormat to this:

TIMESTAMP LEVEL - [LOGGER] PROP(REAL_LOGGER) - MESSAGE

While normally a class name is the logger, there's nothing preventing
you from changing which field is the 'logger' (which field ends up in
the logger tree).  You'll still get logger information displayed in the
REAL_LOGGER column.

The logger tree won't be a tree, but you can select the 'focus on'
logger tree option and select a specific entry to view only events for
that MDC entry.
----------------------------------
Each unique MDC entry on a tab:

Alternatively, you can show each unique MDC entry on its own tab
(probably a lot of tabs if you're using a timestamp), by changing the
'tab identifier' field in the application-wide preferences menu to this:

PROP.SOMEPROPNAME

Now, events are routed to tabs based on the SOMEPROPNAME property (MDC
entry).

----------------------------------
I hope that helps - if you have more questions, let us know.

Scott






-----Original Message-----
From:	Ravishankar, Narayanan Nair
[mailto:ravishankar@crimsonlogic.com]
Sent:	Mon 3/7/2005 6:56 PM
To:	Log4J Users List
Cc:	
Subject:	Regarding Chainsaw
Hi all,

 

I have used Chainsaw successfully. My logs are coming as:

 

2005-03-08 10:28:29,291 DEBUG - [2/8/2005 10:28:13]
comtech.sps.thb.util.ThubLogger - EventHandlerAdapter |
produceToEventHandler | The Status after the event publish : true |
UniqueCodeNo : THBUN1110248909078628

 

As you can see the value - [2/8/2005 10:28:13] is printed because I am
putting the timestamp into MDC. 

 

One clarification please, when concurrent request are coming in, the
timestamps will be different of course. How can I view in Chainsaw as
separate threads with all same timestamps together ? What expression
should I use? Please help and advise, thanks a lot.

 

I love Chainsaw and going to propose for the whole company to adopt :-)

 

Best regards,

Ravi






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