views:

34

answers:

1

Hi,

I have to stop showing logging messages of some methods within the system without changing a Java code (loggers)...

I was thinking, is it possible to configure log4j.properties, where I could skip the logging for certain method? and is it possible to do log on method level at all with log4j?

Thanks, K.

+1  A: 

log4j does not support this level of configuration. But you can implement an appender that will extends your current appender (for example, create a MyConsoleAppender that extends ConsoleAppender). Then, add a check for the method that you which to skip in the checkEntryConditions() method.

Thierry-Dimitri Roy
Thanks, will try it :)
K.E.
edited the answer to replace "implement a logger" with "implement an appender", I assume you meant to refer to appenders
matt b