I have the following problem: Our webapp is running on tomcat 7 and I have an exception that I would like to filter from being written in the log files. The logger is defined in the logging.properties file,
handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
followed by the directory, prefix and format.
Is there any possibility to stop tomcat from writing the exception in the file and onto the console? Because thats what happens right now. I know there are log filters for log4j, but I don't know anything for juli. The exception beeing thrown is:
org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [default] in context with path [] threw exception [javax.servlet.ServletException:
I would be glad if anyone could point me in the direction how to get this exception out of the logs.
Ideas I had so far:
- write a doFilter servlet, that filters the exception out before it arrives at the logger
- modifiy the the java.util.logging library files to reject this certain exception
- route all tomcat logs through log4j and filter there