How to disable any log for stream

I am using org.apache.log4j.Logger for logging and I am developing jsp for monitoring purposes only. This jsp uses classes that write logs (INFO level), not interesting for this monitoring, but annoying if I want to run this jsp very often.

So my question is this: Is there a way to disable these INFO logs only for the thread in which my jsp is running?

If this does not happen, perhaps this approach can pay the bill: Is there a way to specify the log4j level for one given FATAL class in just a few milliseconds?

+5
source share
2 answers

There is no easy way to do this using the simple log4j configuration.

, . . :

http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/spi/Filter.html

  • , , .
  • , LogManager.getLogger( "loggername" )
  • .
+4

? , grep -v INFO?

0

All Articles