Capturing only specific log levels in log4j
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Dave_Harris
Posted On:   Sunday, April 29, 2007 10:14 PM

Hi, I am trying to capture all 'WARN' level messages and send them to the console. I have been looking around the internet and have found the org.apache.log4j.varia.LevelMatchFilter package which I thought would do just that. However, it seems to be a non-exclusive filter. I have this: Which just prints out everything, because this is saying include WARN, which is included anyway. This does work however, when set to FALSE, WARN messages are suppressed. I did manage to get this working by the following hack: Which only captures WARN messages correctly and is really messy. I was just wanting to check that I wasn't doing something really silly!! Thanks    More>>

Hi,

I am trying to capture all 'WARN' level messages and send them to the console. I have been looking around the internet and have found the org.apache.log4j.varia.LevelMatchFilter package which I thought would do just that. However, it seems to be a non-exclusive filter. I have this:




Which just prints out everything, because this is saying include WARN, which is included anyway. This does work however, when set to FALSE, WARN messages are suppressed.

I did manage to get this working by the following hack:





Which only captures WARN messages correctly and is really messy.

I was just wanting to check that I wasn't doing something really silly!!

Thanks for your help in advance.
Dave    <<Less
About | Sitemap | Contact