Your root logger definition is a bit confused.
See the log4j documentation.
This is a standard Java properties file, which means that lines are treated as key=value pairs. Your second log4j.rootLogger
line is overwriting the first, which explains why you aren't seeing anything on the console
appender.
You need to merge your two rootLogger
definitions into one. It looks like you're trying to have DEBUG
messages go to the console and INFO
messages to the file. The root logger can only have one level, so you need to change your configuration so that the appenders have appropriate levels.
While I haven't verified that this is correct, I'd guess it'll look something like this:
log4j.rootLogger=DEBUG,console,file
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.file=org.apache.log4j.RollingFileAppender
Note that you also have an error in casing - you have console lowercase in one place and in CAPS in another.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…