Hi ,

We are using Struts framework for our product(application) and using
logj.properties file to configure logging.

How can i configure Expression-based filters in log4j.properties? Is it
possible to configure in properties file?

One more basic question, Can we use both log4j.properties and log4j.xml file
to configure for an application?
Could anyone clarify me.

Thanks
-Praveen

On 12/29/05, Praveen Kumar Hasthalapuram <[EMAIL PROTECTED]> wrote:
>
> Thanks Scott,
>
> I think this will help me.
>
> Regards,
> Praveen
>
>  On 12/29/05, Scott Deboy <[EMAIL PROTECTED]> wrote:
>
> > You can do this using log4j 1.3 using ExpressionFilter, or you could
> > write your own filter that does the same thing.
> >
> > Route all the events to both file appenders, and specify a different
> > ExpressionFilter on each appender.
> >
> > An example expression you would use with ExpressionFilter:
> > MSG ~= SNMP
> >
> > Remember to put spaces around the operators, etc.
> >
> > You can find out more information on the expression syntax by viewing
> > Chainsaw V2's tutorial:
> > http://logging.apache.org/log4j/docs/chainsaw.html
> >
> > Scott
> >
> > -----Original Message-----
> > From: Praveen Kumar Hasthalapuram [mailto:[EMAIL PROTECTED]
> > Sent: Thu 12/29/2005 9:17 AM
> > To: log4j-user@logging.apache.org
> > Subject: Logging custom levels using log4j
> >
> > Hi All,
> > I need to log specified particular type of messages to one log file and
> > rest
> > to another log file.
> > For example say,  if message contains "SNMP" or "CDP" and so on, need to
> > log
> > in to log1.log and
> > rest of the messages need to log in to log2.log
> > How to configure the log4j.properties to log custom levels?
> > Is there any provision  to create custom levels and to configure it?
> >
> > I heard that we can do this with the use of Filters.
> >
> > Could anyone suggest me better solution for this.
> >
> > Thanks in Advance,
> > Praveen
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>

Reply via email to