Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling awt/swing debug (fine) log messages

Tags:

I'm using java logging to write log messages of my application to a log file and other destinations. Having set the log level to FINE, I also get (unwanted) messages from AWT/Swing, such as:

{0}, when grabbed {1}, contains {2}

and others. Looking at the JDK source code (see e.g. here), one sees that the name of the corresponding logger is sun.awt.X11.grab.XWindowPeer.

What I understood from the Java logging framework is that this logging handler should inherit its loglevel from its parents like sun.awt.

I tried the following:

Logger.getLogger("sun.awt").setLevel(Level.OFF);

but the AWT/Swing debug messages still appear in the log output.

What's the recommended way of programmatically disabling these log messages (while still allowing FINE messages from other sources) ?