You need an 'application' property that is added to every event
processed by an appender (this application property would be unique per
appender).  Once the application property is added to every event, you
can use the default tab identifier in Chainsaw and have events route
correctly to tabs (one tab per appender name/host name pair).

If you can use log4j 1.3 on the appender side, log4j 1.3 includes a
PropertyFilter that will let you do this.  Add a PropertyFilter to each
appender that specifies this property.

Here's the viewCVS entry for PropertyFilter:
http://cvs.apache.org/viewcvs.cgi/logging-log4j/src/java/org/apache/log4
j/filter/PropertyFilter.java?rev=1.1&view=markup

It's a very simple filter - add this to each SocketHubAppender
configuration (change the myapplication value):

     <filter class="org.apache.log4j.filter.PropertyFilter">
       <param name="Properties" value="application=myapplication"/>
     </filter>


Here's a little more background on tab identifier and what the
socket-based appenders provide:

You can use any attribute provided in a logging event to define a tab
identifier.  The keywords used to define the tab identifier are the same
keywords used by the expression syntax (see the Chainsaw tutorial for a
list of keywords).

SocketHubAppender adds a 'log4j.remoteSourceInfo' property to every
event it processes, which contains the source machine and source port,
separated by a colon.

When an event is received by Chainsaw and the event contains a
log4j.remoteSourceInfo property, Chainsaw will create a new property
called 'hostname' containing just the hostname portion of this
log4j.remoteSourceInfo property.

The default tab identifier in Chainsaw V2 is:
PROP.application-PROP.hostname
If an event contains an 'application' property and a 'hostname'
property, these properties will be contatenated together (with a dash in
the middle) and routed to a tab with that name.  What you are seeing is
that there is no 'application' property, but since there was a
log4j.remoteSourceInfo (and thus remoteHost) property, events were
routed to a tab containing a dash followed by the host name.

Scott


-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Rakesh Patel
Sent: Thursday, September 08, 2005 12:35 PM
To: [email protected]
Subject: Re: Chainsaw Tabs

Scott Deboy <sdeboy <at> comotivsystems.com> writes:

> 
> hostname and application properties <MDC> are concatenated to 
> determine the
tab routing..you can change
> this in the app-wide prefs window.
> 
> By the way, socket-based appenders define the hostname property for 
> you -
that's why you see two tabs.
> 
> If you use 1.3, the socketappenders have a param you can set in the 
> config
for the 'application'


i am unfamilar with the <MDC>. what are valid names i can give
appenders. i'd ideally would like to name the tab identifier the same as
the name of the socket hub receiver.






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to