Vojtěch
Vojtěch

Reputation: 12416

Tomcat logging properties filtering

I have simplified tomcat's logging properties to just this:

handlers = java.util.logging.ConsoleHandler

java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.SimpleFormatter.format=%1$tF %1$TT.%1tL [::] %4$s %3$s %5$s %n

org.springframework.aop.framework.CglibAopProxy.level = ERROR

My issue is that the last line seems to be completely ignored and I keep seeing logs like this:

2018-05-09 10:40:33.159 [::] INFO org.springframework.aop.framework.CglibAopProxy

I am absolutely sure it comes from this logger thanks to the log format I set in the logging.properties.

Upvotes: 1

Views: 264

Answers (1)

jmehrens
jmehrens

Reputation: 11045

My issue is that the last line seems to be completely ignored...

It is ignored because ERROR fails to be parsed as valid level. Per the docs:

Valid values are integers between Integer.MIN_VALUE and Integer.MAX_VALUE, and all known level names. Known names are the levels defined by this class (e.g., FINE, FINER, FINEST), or created by this class with appropriate package access, or new levels defined or created by subclasses.

Change your logging line to one of the valid levels that is higher than INFO. Choose one of the following log lines:

org.springframework.aop.framework.CglibAopProxy.level = OFF
org.springframework.aop.framework.CglibAopProxy.level = SEVERE
org.springframework.aop.framework.CglibAopProxy.level = WARNING

Upvotes: 1

Related Questions