You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Keith Schomburg <ks...@cisco.com> on 2001/08/07 22:27:57 UTC

Pattern Strings

Is there a way to specify a different pattern string for 
different priority events.  For example can I define one
format to use for events with a priority of FATAL and
another for all other priorities?  I know you can probably
do this programatically but is there a way to set this up
via a configuration file?

Thanks,
  Keith

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


RE: Pattern Strings

Posted by Keith Schomburg <ks...@cisco.com>.
Ceki,

Thanks for your response.  Are you suggesting to
define multiple appenders with each appender having
its own associated layout pattern?  Then assign
these appenders to a given category such as root.
Then when events are logged against a given
category the associated appenders will determine
one if the event should be logged and two what
format to use if it is logged.

The only question I have is how can I limit an
appender to only log one level of priority?
I believe using an XML configuration file you
could do this via the PriorityMatchFilter or
PriorityRangeFilter but can you set this up
using a property file?

Thanks,
  Keith

> -----Original Message-----
> From: Ceki Gülcü [mailto:cgu@qos.ch]
> Sent: Tuesday, August 14, 2001 3:23 PM
> To: LOG4J Users Mailing List
> Subject: RE: Pattern Strings
>
>
> Keith,
>
> What you can do is to log different priorities to different
> appenders. You can then attach a different layout (e.g. a
> PatternLayout) to each appender. Hope this helps, Ceki
>
> At 15:08 14.08.2001 -0400, Keith Schomburg wrote:
> >I posted this attached question a week ago and
> >have seen a similiar question from another person
> >neither of which received a response.  Should we
> >assume that no reply is an indication that this
> >can not be done?
> >
> >Thanks,
> >  Keith
> >
> >> -----Original Message-----
> >>
> >> Is there a way to specify a different pattern string for
> >> different priority events.  For example can I define one
> >> format to use for events with a priority of FATAL and
> >> another for all other priorities?  I know you can probably
> >> do this programatically but is there a way to set this up
> >> via a configuration file?
> >>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>
> --
> Ceki Gülcü - http://qos.ch
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>


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


RE: Pattern Strings

Posted by Ceki Gülcü <cg...@qos.ch>.
Keith,

What you can do is to log different priorities to different appenders. You can then attach a different layout (e.g. a PatternLayout) to each appender. Hope this helps, Ceki

At 15:08 14.08.2001 -0400, Keith Schomburg wrote:
>I posted this attached question a week ago and 
>have seen a similiar question from another person 
>neither of which received a response.  Should we
>assume that no reply is an indication that this 
>can not be done?
>
>Thanks,
>  Keith
>
>> -----Original Message-----
>> 
>> Is there a way to specify a different pattern string for 
>> different priority events.  For example can I define one
>> format to use for events with a priority of FATAL and
>> another for all other priorities?  I know you can probably
>> do this programatically but is there a way to set this up
>> via a configuration file?
>> 
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org

--
Ceki Gülcü - http://qos.ch


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


RE: Pattern Strings

Posted by Keith Schomburg <ks...@cisco.com>.
I posted this attached question a week ago and 
have seen a similiar question from another person 
neither of which received a response.  Should we
assume that no reply is an indication that this 
can not be done?

Thanks,
  Keith

> -----Original Message-----
> 
> Is there a way to specify a different pattern string for 
> different priority events.  For example can I define one
> format to use for events with a priority of FATAL and
> another for all other priorities?  I know you can probably
> do this programatically but is there a way to set this up
> via a configuration file?
> 


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