[slf4j-user] Log4j.properties?

Robert Elliot rob at lidalia.org.uk
Tue Mar 1 22:03:56 CET 2011


You are using slf4j-simple, not log4j as your logging system - it doesn't take any config, it just prints all logs of info or above to the command line.

If you want to use log4j as your logging system, take log4j-over-slf4j-1.6.1.jar and slf4j-simple-1.6.1.jar off your classpath and instead add slf4j-logj12.jar.  Now SLF4J will direct all your logging to log4j so your log4j.properties should work.

----- Original Message -----
> From: "Adam Parkin" <pzelnip at gmail.com>
> To: slf4j-user at qos.ch
> Sent: Tuesday, 1 March, 2011 8:35:07 PM
> Subject: [slf4j-user] Log4j.properties?
> I'm finding the documentation on how to specify a log4j.properties
> file
> a bit weak.
> 
> As it stands I have a standalone Java application which is using SLF4J
> overtop the Log4j library (I have log4j-over-slf4j-1.6.1.jar,
> slf4j-api-1.6.1.jar, slf4j-simple-1.6.1.jar files on the classpath).
> 
> I want to be able to modify it so that DEBUG messages appear on the
> console, normally this is done by creating a log4j.properties file if
> using log4j. I've done this, but it would appear the file is not being
> read as I still only see info & higher messages.
> 
> How do I instruct SLF4J to read a log4j.properties file (or for that
> matter, how do I specify a log level in SLF4J)? Where does the file
> go?
> How do I instruct the libraries to read that file? etc.
> 
> Thanks.
> 
> _______________________________________________
> slf4j-user mailing list
> slf4j-user at qos.ch
> http://qos.ch/mailman/listinfo/slf4j-user


More information about the slf4j-user mailing list