Hi!
I'm trying to learn about java.util.logging with a really basic Maven project.
I have a single class "HelloWorld" wich contains:
package fr.ill.ics.log;
import java.util.logging.Level;
import java.util.logging.Logger;
public class HelloWorld {
private static Logger logger = Logger.getLogger(HelloWorld.class.getName());
public static void main(String[] args) {
logger.info("INFO log");
logger.log(Level.WARNING, "WARNING log");
logger.log(Level.SEVERE, "SEVERE log");
}
}
and a logging.properties file in my directory "src/main/resources":
handlers=java.util.logging.FileHandler,java.util.l ogging.ConsoleHandler
.level=SEVERE
java.util.logging.FileHandler.pattern=%h/java%u.log
java.util.logging.FileHandler.limit=50000
java.util.logging.FileHandler.count=1
java.util.logging.FileHandler.formatter=java.util. logging.XMLFormatter
java.util.logging.ConsoleHandler.formatter=java.ut il.logging.SimpleFormatter
java.util.logging.SimpleFormatter.format=[%1$tc] %4$s: %5$s %n
The problem is that my main class totally ignores the configuration file, I can see that when I change the log level inside logging.properties.
What am I doing wrong ?
Thanks!