K.E.
K.E.

Reputation: 1

log4j property configuration question

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.

Upvotes: 0

Views: 687

Answers (1)

Thierry Roy
Thierry Roy

Reputation: 8512

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.

Upvotes: 1

Related Questions