FAQ

Q&A

Q:

In the program, there is a warning “[WARN] Can not find [logging.properties], use [%JRE_HOME%/lib/logging.properties] as default!” How can I solve this problem?

A:

This is because you haven’t introduced any third-party logging framework. Hutool uses JDK Logging as its default logging implementation. The warning message means that you haven’t put the logging.properties file (the configuration file for JDK Logging) in your ClassPath, so the system is using the default configuration file in the JDK directory. You can consider putting a logging.properties file in your ClassPath (e.g., under src/main/resources).

The template for the configuration file can be found at: https://gitee.com/dromara/hutool/blob/v5-master/hutool-log/src/test/resources/logging.properties

Templates for configuration files of other logging frameworks can be found at: https://gitee.com/dromara/hutool/tree/v5-master/hutool-log/src/test/resources

Note: In the new version of Hutool, it will automatically detect the presence of logging.properties. If this configuration file does not exist, JDK-Logging will be skipped and Console-log (command line printing of logs) will be used instead.