Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

slf4j + java.util.logging: how to configure?

I'm trying to use slf4j + java.util.logging. I know how to set up the Java source code to do this via logger = LoggerFactory.getLogger(...) and logger.warn('...') or whatever.

But where's the documentation for setting up the configuration in slf4j? I'm very confused... I have the log4j manual and am familiar w/ the very basics of logging adapters, but I'm just not sure how to get this to work with slf4j + java.util.logging.

namely:

  • which .properties file and/or JVM -D command-line argument do I need to specify to point it at my configuration file?

  • where's the documentation for the configuration file for java.util.logging?

  • does using slf4j cause any change in my configuration file? (i.e. something that I would have to declare differently, vs. just using java.util.logging or log4j directly)

like image 669
Jason S Avatar asked Apr 15 '11 19:04

Jason S


1 Answers

See this tutorial on jul:

java -Djava.util.logging.config.file=myLoggingConfigFilePath

But I would recommend to go for Logback

like image 92
moritz Avatar answered Oct 10 '22 21:10

moritz