How to config LevelMatchFilter

2005-11-01 Thread Xin Zhao
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.

Re: How to config LevelMatchFilter

2005-11-01 Thread James Stauffer
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 <[EMAIL PROTECTED]> wrote: > hi

Re: How to config LevelMatchFilter

2005-11-01 Thread Xin Zhao
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 <[EMAIL PROTECTED]> wrote: > > What are you trying to do? It appears that you only want ERROR and > higher but you use LevelToMatch to

Re: How to config LevelMatchFilter

2005-11-01 Thread James Stauffer
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 <[EMAIL PROTECTED]> wrote: > Sorry, my example is wrong, i should set the acceptOnMatch to be true. > > I try to send out email only when E

Re: How to config LevelMatchFilter

2005-11-01 Thread Xin Zhao
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 <[EMAIL PROTECTED]> wrote: > > Assuming you also want emails for FATAL logs then you don't need > LevelMatchFilter. Just setting the Threshold t

Re: How to config LevelMatchFilter

2005-11-01 Thread James Stauffer
I only use XML config so I don't know. On 11/1/05, Xin Zhao <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> wrote: > > > > Assuming

RE: How to config LevelMatchFilter

2005-11-01 Thread Bender Heri
IIRC you can't use Filters in property files, only in xml. Heri > -Original Message- > From: James Stauffer [mailto:[EMAIL PROTECTED] > Sent: Tuesday, November 01, 2005 4:18 PM > To: Log4J Users List > Subject: Re: How to config LevelMatchFilter > > > I only use XML config so I don't kn

Basic Assistance

2005-11-01 Thread Robert Palmer
I am trying to understand the best approach to implementing log4j on a Tomcat server within my application. I feel this is a pretty basic question so apologies if it is. I have a number of session scope beans and request scope beans that I want to log from. The approaches I see are: 1. simply

Re: How to config LevelMatchFilter

2005-11-01 Thread Xin Zhao
I think maybe it is a feature they could add into log4j. So we could use the Filters in property file like what we do with the layout log4j.appender.emailWarnLog.layout org.apache.log4j.PatternLayout David On 11/1/05, Bender Heri <[EMAIL PROTECTED]> wrote: > > IIRC you can't use Filters in prop

Re: How to config LevelMatchFilter

2005-11-01 Thread James Stauffer
Why do you want to use a property file instead of an XML file? Actually in 1.3 there will be a new preferred (and more powerful) config file format so properties files will be 2 generations old. On 11/1/05, Xin Zhao <[EMAIL PROTECTED]> wrote: > I think maybe it is a feature they could add into lo

Re: Basic Assistance

2005-11-01 Thread James Stauffer
Take a look at http://logging.apache.org/log4j/docs/manual.html Bascially each class should have something like the following (and it isn't expensive) Logger myLogger = Logger.getLogger("com.project.class"); On 11/1/05, Robert Palmer <[EMAIL PROTECTED]> wrote: > I am trying to understand the best

Re: How to config LevelMatchFilter

2005-11-01 Thread Xin Zhao
In xml file, could you do the cross reference like the followed example (LOG_DIR, CONVERSION_PATTERN)? - LOG_DIR ../Log APP_NAME tmsFeed CONVERSION_PATTERN %d{MMMdd_HHmmss}%5p: %m%n log4j.rootLogger INFO, console, log, emailWarnLog log4j.appender.console org.apache.log4j.ConsoleAppen

Re: How to config LevelMatchFilter

2005-11-01 Thread James Stauffer
I have never used those so I don't know. On 11/1/05, Xin Zhao <[EMAIL PROTECTED]> wrote: > In xml file, could you do the cross reference like the followed > example (LOG_DIR, > CONVERSION_PATTERN)? > > > - > LOG_DIR ../Log > APP_NAME tmsFeed > CONVERSION_PATTERN %d{MMMdd_HHmmss}%5p: %m

Re: Cross-platform File appender paths?

2005-11-01 Thread shy guy
I m using some code to create dir if it does not exist, in my own appender If someone can put it in setFile() in log4j code, it would be great! ks public void createDirs(String fileName) { try { File f = new File(fileName); String dir = f.getCanonicalPath(); System.out.println("log4j log is here

Re: How to config LevelMatchFilter

2005-11-01 Thread Xin Zhao
Now I have tried to ues the xml config file as followed. But I still got two email from log4j when Error Level reached. Could anyone have a look? - http://SMTPMAIL.xxx.COM>"/> http://SMTPMAIL.xxx.COM>"/> David On 11/1/05, James Stauffer <[EMAIL PROTECTED]>

Re: Cross-platform File appender paths?

2005-11-01 Thread Jacob Kjome
At 11:42 AM 11/1/2005 -0500, you wrote: >I m using some code to create dir if it does not exist, in my own appender > If someone can put it in setFile() in log4j code, it would be great! I believe this is now done in Log4j-1.3, but I'm not 100% sure about that. I recall there was a discussion a

RE: How to config LevelMatchFilter

2005-11-01 Thread Bender Heri
So far it looks correct. Can you supply also the logger definition(s)? What happens on a WARN event? Heri > -Original Message- > From: Xin Zhao [mailto:[EMAIL PROTECTED] > Sent: Tuesday, November 01, 2005 6:22 PM > To: Log4J Users List > Subject: Re: How to config LevelMatchFilter > >

Re: How to config LevelMatchFilter

2005-11-01 Thread Xin Zhao
I think the problem is I need add a on errorWarnLog On 11/1/05, Bender Heri <[EMAIL PROTECTED]> wrote: > > So far it looks correct. > Can you supply also the logger definition(s)? > What happens on a WARN event? > > Heri > > > -Original Message- > > From: Xin Zhao [mailto:[EMAIL PROTECT