They way Java Util Logging works, it does not automatically find the logging.properties
on your classpath. You need to set the java.util.logging.config.file
system property.
For example, say this is your custom logging.properties
:
# Handler details
handlers=java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level=ALL
java.util.logging.SimpleFormatter.format=%4$-7s [%3$s] %5$s%6$s%n
# Log level details
.level=ALL
Place the file in the root of your classpath, e.g. src/main/resources
if you are using Maven. Depending on how you deploy your application, set the system property java.util.logging.config.file
to logging.properties
. For example, if you are deploying with tomcat7-maven-plugin:
mvn tomcat7:deploy -Djava.util.logging.config.file=logging.properties
You will see everything:
Jan 03, 2019 12:09:05 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /usr/local/tomcat/webapps/Example.war
Jan 03, 2019 12:09:05 AM org.apache.tomcat.util.scan.StandardJarScanner scan
FINER: Scanning WEB-INF/lib for JARs
Jan 03, 2019 12:09:05 AM org.apache.tomcat.util.scan.StandardJarScanner scan
FINE: Scanning JAR [/WEB-INF/lib/jersey-common-2.27.jar] from WEB-INF/lib
Jan 03, 2019 12:09:05 AM org.apache.tomcat.util.scan.StandardJarScanner process
FINER: Scanning JAR at URL [file:/usr/local/tomcat/webapps/Example/WEB-INF/lib/jersey-common-2.27.jar]
Jan 03, 2019 12:09:05 AM org.apache.tomcat.util.scan.StandardJarScanner scan
...