If you're using log4j 1.2.15 with the log4j extras companion, you can use an ExpressionFilter and exclude events using this expression:
EXCEPTION exists To exclude all exceptions Or EXCEPTION ~= org.hibernate.ObjectNotFoundException To exclude only exceptions with that string in the exception text Extras companion available here: http://logging.apache.org/log4j/companions/extras/index.html Here's expressionFilter: https://svn.apache.org/repos/asf/logging/site/trunk/docs/log4j/companion s/extras/apidocs/org/apache/log4j/filter/ExpressionFilter.html Scott Deboy Principal Engineer COMOTIV SYSTEMS 111 SW Columbia Street Ste. 950 Portland, OR 97201 Office: 503.224.7496 Direct Line: 503.821.6482 Cell: 503.997.1367 Fax: 503.222.0185 [EMAIL PROTECTED] www.comotivsystems.com -----Original Message----- From: Sergio [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2008 1:57 PM To: [email protected] Subject: Suppress specific Exception Hi, I have the annoying uncatchable ObjectNotFoundException from hibernate on my log with big stack traces. I want to completely suppress this exception from my log. I tried to find something about filters on Log4J, but I think that is not the correct way to do it. Any ideas on how I can suppress an exception from being add to the log? Thanks in advance, S --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
