I created simple application to test java.util.logging
behaviour:
public static void main(String[] args) {
Logger logger = Logger.getLogger("sample-name");
logger.log(Level.SEVERE, "SEVERE");
logger.log(Level.WARNING, "WARNING");
logger.log(Level.INFO, "INFO");
logger.log(Level.CONFIG, "CONFIG");
logger.log(Level.FINE, "FINE");
logger.log(Level.FINER, "FINE");
logger.log(Level.FINEST, "FINEST");
}
and enabled logging to file in /usr/lib/jvm/java-11-openjdk/conf/logging.properties:
handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler
When I leave logging level in this file (.level) INFO, it works file. There is a java0.log output file in my user.home with following content:
Aug 29, 2019 4:57:48 PM main.LoggingTester main
SEVERE: SEVERE
Aug 29, 2019 4:57:48 PM main.LoggingTester main
WARNING: WARNING
Aug 29, 2019 4:57:48 PM main.LoggingTester main
INFO: INFO
But I want to log ALL - ant after changing it to ALL, something weird happen - here is the content of the output file:
Aug 29, 2019 5:00:32 PM com.sun.jna.Native extractFromResourcePath
FINE: Looking in classpath from java.net.URLClassLoader@5305068a for /com/sun/jna/linux-x86-64/libjnidispatch.so
Aug 29, 2019 5:00:32 PM com.sun.jna.Native extractFromResourcePath
FINE: Found library resource at jar:file:/opt/intellij/idea-IC-191.6707.61/lib/jna.jar!/com/sun/jna/linux-x86-64/libjnidispatch.so
Aug 29, 2019 5:00:32 PM com.sun.jna.Native extractFromResourcePath
FINE: Extracting library to /home/iid/.cache/JNA/temp/jna7163336009872108237.tmp
Aug 29, 2019 5:00:32 PM com.sun.jna.Native loadNativeDispatchLibraryFromClasspath
FINE: Trying /home/iid/.cache/JNA/temp/jna7163336009872108237.tmp
Aug 29, 2019 5:00:32 PM com.sun.jna.Native loadNativeDispatchLibraryFromClasspath
FINE: Found jnidispatch at /home/iid/.cache/JNA/temp/jna7163336009872108237.tmp
Additionaly, java0.log.lock file is created.
I guess something else takes this log and writes to it? Because this setting is global. But the lock persists even that my application finished it's life, and I would expect some other log file, which would actually contain also my messages...