I'm using log4j (compile group slf4j, runtime group logback) with configuration in log4j.properties file.
I think I configured it properly with this options
log4j.rootLogger=INFO, stdout, file
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
log4j.appender.stdout.threshold=info
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=/home/user/logging.log
log4j.appender.file.MaxFileSize=5MB
log4j.appender.file.MaxBackupIndex=20
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%-5p [%d{dd.MM.yy HH:mm:ss}] %C{1} - %m [thread: %t]\n
log4j.appender.file.threshold=info
But when I run debug message like
logger.debug("foo")
I see output in Console which doesn't match my pattern.
Next problem is that nothing is in file (/home/user/logging.log) so I think my properties file is not loaded and don't know how to repair it.
I put my log4j.properties file in root level of my eclipse project, in resources (src/main/resources) but still is nothing changed. I have my Project folder in classpath properly.
EDIT: The problem was that I'm using Logback
(http://logback.qos.ch/) as my runtime Logger, but this library using logback.xml
config file, not log4j.properties
with org.apache.log4j
library.