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 Xin Zhao <da...@gmail.com> on 2005/11/01 15:47:31 UTC

How to config LevelMatchFilter

hi all,

I am trying to config the SMTPAppender with LevelMatchFilter by using the
plain config file as followed. But it does not work. Some one said the
LevelMatchFilter only works in XML config file. Is it true?

-------------------------------------------------


log4j.appender.emailWarnLog org.apache.log4j.net.SMTPAppender
log4j.appender.emailWarnLog.SMTPHost SMTPMAIL.xxx.COM<http://SMTPMAIL.xxx.COM>
log4j.appender.emailWarnLog.To <http://log4j.appender.emailWarnLog.To>
David.Zhao@xxx.com
log4j.appender.emailWarnLog.From Murex_TMS_Feed
log4j.appender.emailWarnLog.Subject Ignore one event
log4j.appender.emailWarnLog.filter org.apache.log4j.varia.LevelMatchFilter
log4j.appender.emailWarnLog.filter.LevelToMatch ERROR
log4j.appender.emailWarnLog.filter.AcceptOnMatch false
log4j.appender.emailWarnLog.layout org.apache.log4j.PatternLayout
log4j.appender.emailWarnLog.layout.ConversionPattern ${CONVERSION_PATTERN}
log4j.appender.emailWarnLog.Threshold ERROR

David

Re: How to config LevelMatchFilter

Posted by James Stauffer <st...@gmail.com>.
I only use XML config so I don't know.

On 11/1/05, Xin Zhao <da...@gmail.com> wrote:
> No, I only need ERROR level.
>
> And my real question is if i could use the LevelMatchFilter in plain conifg
> file not xml.
>
> David
>
> On 11/1/05, James Stauffer <st...@gmail.com> wrote:
> >
> > Assuming you also want emails for FATAL logs then you don't need
> > LevelMatchFilter. Just setting the Threshold to ERROR should work
> > fine.
> >
> > On 11/1/05, Xin Zhao <da...@gmail.com> wrote:
> > > Sorry, my example is wrong, i should set the acceptOnMatch to be true.
> > >
> > > I try to send out email only when ERROR level is reached.
> > >
> > > David
> > >
> > > On 11/1/05, James Stauffer <st...@gmail.com> wrote:
> > > >
> > > > What are you trying to do? It appears that you only want ERROR and
> > > > higher but you use LevelToMatch to reject ERROR.
> > > > Also, I think SMTPAppender has a buffer so it only sends an email when
> > > > it has a certain amount of data or there is an ERROR log.
> > > >
> > > > On 11/1/05, Xin Zhao <da...@gmail.com> wrote:
> > > > > hi all,
> > > > >
> > > > > I am trying to config the SMTPAppender with LevelMatchFilter by
> > using
> > > > the
> > > > > plain config file as followed. But it does not work. Some one said
> > the
> > > > > LevelMatchFilter only works in XML config file. Is it true?
> > > > >
> > > > > -------------------------------------------------
> > > > >
> > > > >
> > > > > log4j.appender.emailWarnLog org.apache.log4j.net.SMTPAppender
> > > > > log4j.appender.emailWarnLog.SMTPHost SMTPMAIL.xxx.COM<http://SMTPMAIL.xxx.COM>
> > <http://SMTPMAIL.xxx.COM>
> > > > <http://SMTPMAIL.xxx.COM>
> > > > > log4j.appender.emailWarnLog.To<http://log4j.appender.emailWarnLog.To><
> > http://log4j.appender.emailWarnLog.To> <
> > > > http://log4j.appender.emailWarnLog.To>
> > > > > David.Zhao@xxx.com
> > > > > log4j.appender.emailWarnLog.From Murex_TMS_Feed
> > > > > log4j.appender.emailWarnLog.Subject Ignore one event
> > > > > log4j.appender.emailWarnLog.filter
> > > > org.apache.log4j.varia.LevelMatchFilter
> > > > > log4j.appender.emailWarnLog.filter.LevelToMatch ERROR
> > > > > log4j.appender.emailWarnLog.filter.AcceptOnMatch false
> > > > > log4j.appender.emailWarnLog.layout org.apache.log4j.PatternLayout
> > > > >
> > log4j.appender.emailWarnLog.layout.ConversionPattern${CONVERSION_PATTERN}
> > > > > log4j.appender.emailWarnLog.Threshold ERROR
> > > > >
> > > > > David
> > > > >
> > > >
> > > >
> > > > --
> > > > James Stauffer
> > > > Are you good? Take the test at http://www.livingwaters.com/good/
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > > >
> > > >
> > >
> >
> >
> > --
> > James Stauffer
> > Are you good? Take the test at http://www.livingwaters.com/good/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>


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

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


Re: How to config LevelMatchFilter

Posted by Xin Zhao <da...@gmail.com>.
No, I only need ERROR level.

And my real question is if i could use the LevelMatchFilter in plain conifg
file not xml.

David

On 11/1/05, James Stauffer <st...@gmail.com> wrote:
>
> Assuming you also want emails for FATAL logs then you don't need
> LevelMatchFilter. Just setting the Threshold to ERROR should work
> fine.
>
> On 11/1/05, Xin Zhao <da...@gmail.com> wrote:
> > Sorry, my example is wrong, i should set the acceptOnMatch to be true.
> >
> > I try to send out email only when ERROR level is reached.
> >
> > David
> >
> > On 11/1/05, James Stauffer <st...@gmail.com> wrote:
> > >
> > > What are you trying to do? It appears that you only want ERROR and
> > > higher but you use LevelToMatch to reject ERROR.
> > > Also, I think SMTPAppender has a buffer so it only sends an email when
> > > it has a certain amount of data or there is an ERROR log.
> > >
> > > On 11/1/05, Xin Zhao <da...@gmail.com> wrote:
> > > > hi all,
> > > >
> > > > I am trying to config the SMTPAppender with LevelMatchFilter by
> using
> > > the
> > > > plain config file as followed. But it does not work. Some one said
> the
> > > > LevelMatchFilter only works in XML config file. Is it true?
> > > >
> > > > -------------------------------------------------
> > > >
> > > >
> > > > log4j.appender.emailWarnLog org.apache.log4j.net.SMTPAppender
> > > > log4j.appender.emailWarnLog.SMTPHost SMTPMAIL.xxx.COM<http://SMTPMAIL.xxx.COM>
> <http://SMTPMAIL.xxx.COM>
> > > <http://SMTPMAIL.xxx.COM>
> > > > log4j.appender.emailWarnLog.To<http://log4j.appender.emailWarnLog.To><
> http://log4j.appender.emailWarnLog.To> <
> > > http://log4j.appender.emailWarnLog.To>
> > > > David.Zhao@xxx.com
> > > > log4j.appender.emailWarnLog.From Murex_TMS_Feed
> > > > log4j.appender.emailWarnLog.Subject Ignore one event
> > > > log4j.appender.emailWarnLog.filter
> > > org.apache.log4j.varia.LevelMatchFilter
> > > > log4j.appender.emailWarnLog.filter.LevelToMatch ERROR
> > > > log4j.appender.emailWarnLog.filter.AcceptOnMatch false
> > > > log4j.appender.emailWarnLog.layout org.apache.log4j.PatternLayout
> > > >
> log4j.appender.emailWarnLog.layout.ConversionPattern${CONVERSION_PATTERN}
> > > > log4j.appender.emailWarnLog.Threshold ERROR
> > > >
> > > > David
> > > >
> > >
> > >
> > > --
> > > James Stauffer
> > > Are you good? Take the test at http://www.livingwaters.com/good/
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > >
> > >
> >
>
>
> --
> James Stauffer
> Are you good? Take the test at http://www.livingwaters.com/good/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

Re: How to config LevelMatchFilter

Posted by James Stauffer <st...@gmail.com>.
Assuming you also want emails for FATAL logs then you don't need
LevelMatchFilter.  Just setting the Threshold to ERROR should work
fine.

On 11/1/05, Xin Zhao <da...@gmail.com> wrote:
> Sorry, my example is wrong, i should set the acceptOnMatch to be true.
>
> I try to send out email only when ERROR level is reached.
>
> David
>
> On 11/1/05, James Stauffer <st...@gmail.com> wrote:
> >
> > What are you trying to do? It appears that you only want ERROR and
> > higher but you use LevelToMatch to reject ERROR.
> > Also, I think SMTPAppender has a buffer so it only sends an email when
> > it has a certain amount of data or there is an ERROR log.
> >
> > On 11/1/05, Xin Zhao <da...@gmail.com> wrote:
> > > hi all,
> > >
> > > I am trying to config the SMTPAppender with LevelMatchFilter by using
> > the
> > > plain config file as followed. But it does not work. Some one said the
> > > LevelMatchFilter only works in XML config file. Is it true?
> > >
> > > -------------------------------------------------
> > >
> > >
> > > log4j.appender.emailWarnLog org.apache.log4j.net.SMTPAppender
> > > log4j.appender.emailWarnLog.SMTPHost SMTPMAIL.xxx.COM<http://SMTPMAIL.xxx.COM>
> > <http://SMTPMAIL.xxx.COM>
> > > log4j.appender.emailWarnLog.To <http://log4j.appender.emailWarnLog.To> <
> > http://log4j.appender.emailWarnLog.To>
> > > David.Zhao@xxx.com
> > > log4j.appender.emailWarnLog.From Murex_TMS_Feed
> > > log4j.appender.emailWarnLog.Subject Ignore one event
> > > log4j.appender.emailWarnLog.filter
> > org.apache.log4j.varia.LevelMatchFilter
> > > log4j.appender.emailWarnLog.filter.LevelToMatch ERROR
> > > log4j.appender.emailWarnLog.filter.AcceptOnMatch false
> > > log4j.appender.emailWarnLog.layout org.apache.log4j.PatternLayout
> > > log4j.appender.emailWarnLog.layout.ConversionPattern${CONVERSION_PATTERN}
> > > log4j.appender.emailWarnLog.Threshold ERROR
> > >
> > > David
> > >
> >
> >
> > --
> > James Stauffer
> > Are you good? Take the test at http://www.livingwaters.com/good/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>


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

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


Re: How to config LevelMatchFilter

Posted by Xin Zhao <da...@gmail.com>.
Sorry, my example is wrong, i should set the acceptOnMatch to be true.

I try to send out email only when ERROR level is reached.

David

On 11/1/05, James Stauffer <st...@gmail.com> wrote:
>
> What are you trying to do? It appears that you only want ERROR and
> higher but you use LevelToMatch to reject ERROR.
> Also, I think SMTPAppender has a buffer so it only sends an email when
> it has a certain amount of data or there is an ERROR log.
>
> On 11/1/05, Xin Zhao <da...@gmail.com> wrote:
> > hi all,
> >
> > I am trying to config the SMTPAppender with LevelMatchFilter by using
> the
> > plain config file as followed. But it does not work. Some one said the
> > LevelMatchFilter only works in XML config file. Is it true?
> >
> > -------------------------------------------------
> >
> >
> > log4j.appender.emailWarnLog org.apache.log4j.net.SMTPAppender
> > log4j.appender.emailWarnLog.SMTPHost SMTPMAIL.xxx.COM<http://SMTPMAIL.xxx.COM>
> <http://SMTPMAIL.xxx.COM>
> > log4j.appender.emailWarnLog.To <http://log4j.appender.emailWarnLog.To> <
> http://log4j.appender.emailWarnLog.To>
> > David.Zhao@xxx.com
> > log4j.appender.emailWarnLog.From Murex_TMS_Feed
> > log4j.appender.emailWarnLog.Subject Ignore one event
> > log4j.appender.emailWarnLog.filter
> org.apache.log4j.varia.LevelMatchFilter
> > log4j.appender.emailWarnLog.filter.LevelToMatch ERROR
> > log4j.appender.emailWarnLog.filter.AcceptOnMatch false
> > log4j.appender.emailWarnLog.layout org.apache.log4j.PatternLayout
> > log4j.appender.emailWarnLog.layout.ConversionPattern${CONVERSION_PATTERN}
> > log4j.appender.emailWarnLog.Threshold ERROR
> >
> > David
> >
>
>
> --
> James Stauffer
> Are you good? Take the test at http://www.livingwaters.com/good/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

Re: How to config LevelMatchFilter

Posted by James Stauffer <st...@gmail.com>.
What are you trying to do?  It appears that you only want ERROR and
higher but you use LevelToMatch to reject ERROR.
Also, I think SMTPAppender has a buffer so it only sends an email when
it has a certain amount of data or there is an ERROR log.

On 11/1/05, Xin Zhao <da...@gmail.com> wrote:
> hi all,
>
> I am trying to config the SMTPAppender with LevelMatchFilter by using the
> plain config file as followed. But it does not work. Some one said the
> LevelMatchFilter only works in XML config file. Is it true?
>
> -------------------------------------------------
>
>
> log4j.appender.emailWarnLog org.apache.log4j.net.SMTPAppender
> log4j.appender.emailWarnLog.SMTPHost SMTPMAIL.xxx.COM<http://SMTPMAIL.xxx.COM>
> log4j.appender.emailWarnLog.To <http://log4j.appender.emailWarnLog.To>
> David.Zhao@xxx.com
> log4j.appender.emailWarnLog.From Murex_TMS_Feed
> log4j.appender.emailWarnLog.Subject Ignore one event
> log4j.appender.emailWarnLog.filter org.apache.log4j.varia.LevelMatchFilter
> log4j.appender.emailWarnLog.filter.LevelToMatch ERROR
> log4j.appender.emailWarnLog.filter.AcceptOnMatch false
> log4j.appender.emailWarnLog.layout org.apache.log4j.PatternLayout
> log4j.appender.emailWarnLog.layout.ConversionPattern ${CONVERSION_PATTERN}
> log4j.appender.emailWarnLog.Threshold ERROR
>
> David
>


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

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