Write an MDCFilter

-----Original Message-----
From: Schuweiler, Joel J. [mailto:[EMAIL PROTECTED]
Sent: Monday, June 27, 2005 3:52 PM
To: 'Log4J Users List'
Subject: RE: Filter based on category?


The problem with this approach is there is no filter that will check the mdc 
information. StringMatchFilter ONLY matches on the message.

-----Original Message-----
From: Schuweiler, Joel J. [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 27, 2005 3:49 PM
To: 'Log4J Users List'
Subject: RE: Filter based on category?

Seems that if I do 

MDC.put("Department, "Security")

On the client side and on the server use a patternlayout and do %X{Department} 
I should be able to sort on that.. Hopefully... I will find out 

-----Original Message-----
From: Kostello, Don [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 27, 2005 3:21 PM
To: Log4J Users List
Subject: RE: Filter based on category?

I would think you could do this using NDC.

On the client side, you could do an NDC.push(Identifier).

On the server side, have multiple file appenders.  Set the layout to include 
the NDC information.  Then, add a string match filter to each appender, 
checking for the various identifiers.

Not sure about this solution (never used filters), but it sounds good from an 
API point of view to a relative novice like me.

Don K

-----Original Message-----
From: Schuweiler, Joel J. [mailto:[EMAIL PROTECTED]
Sent: Monday, June 27, 2005 2:29 PM
To: 'Log4J Users List'
Subject: RE: Filter based on category?


Ok for a lack of a good universal drawing tool I'm going to do dreaded ascii


Applications on a cluster <-> serialized log event <-> socket <-> internet <-> 
socket server <-> unserialized log event

On the socket server I'm looking for an easy way to tell who sent the log 
event. Is there an easy way to do this by naming the loggers a specific way and 
how would I handle this in my config?



-----Original Message-----
From: James Stauffer [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 27, 2005 2:26 PM
To: Log4J Users List
Subject: Re: Filter based on category?

That doesn't make sense to me.  That sounds wrong.  Can you give more details?

On 6/27/05, Schuweiler, Joel J. <[EMAIL PROTECTED]> wrote:
> If I use a dot it strips off the left side in the logging event
> 
> -----Original Message-----
> From: James Stauffer [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 27, 2005 2:17 PM
> To: Log4J Users List
> Subject: Re: Filter based on category?
> 
> I don't understand why you want to replace the dot with the underscore.
> 
> Are you trying to separate your logs based on the type of program?
> 
> On 6/27/05, Schuweiler, Joel J. <[EMAIL PROTECTED]> wrote:
> > I would do something like
> >
> > static Logger logger = Logger.getLogger("joel.SecondLogger");
> >
> > However if I want to do this it appears I need to make a custom filter and 
> > rename it to joel_SecondLogger (_ could be any char but .). This also 
> > leaves me with having to modify the log4j jar's that come with for ex. 
> > Jboss.
> >
> > At this point it might be best to just do
> >
> > static Logger logger = Logger.getLogger("SecondLogger.joel");
> >
> > -----Original Message-----
> > From: James Stauffer [mailto:[EMAIL PROTECTED]
> > Sent: Monday, June 27, 2005 1:59 PM
> > To: Log4J Users List
> > Subject: Re: Filter based on category?
> >
> > Does that mean that you would have a logger named something like
> > edu.mayo.package.myClass.WebApps?
> >
> > Is there a reason that you can't name it WebApps.edu.mayo.package.myClass?
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> --
> James Stauffer
> Are you good? Take the test at http://www.livingwaters.com/good/
> 
> ---------------------------------------------------------------------
> 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]
> 
> 


-- 
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

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


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

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