I used to have log4j working in a Web/Static Web Project, but then I switched over to a MyEclipse/J2EE Projects/Web Project, cos I was tired of the IDE not recognizing JSTL.
System:
WinXP Pro
MyEclipse 4.1.1
Tomcat 5.0
j2sdk1.4.2_11
Now when I start my server (in the IDE), I get the well-known
log4j:WARN No appenders could be found for logger (org.apache.catalina.startup.Embedded).
log4j:WARN Please initialize the log4j system properly.
which I had gotten rid of before by adding a log4j.properties file to the src dir of my project, the contents of which are
log4j.rootCategory=CONSOLE1, ROLLING1
# CONSOLE1
log4j.appender.CONSOLE1=org.apache.log4j.ConsoleAppender
# CONSOLE1 uses TTCC (Time, Thread Category, Context) Layout, because it’s nice and we’re lazy.
# Levels used to be called Categories in older versions of log4j.
log4j.appender.CONSOLE1.layout=org.apache.log4j.TTCCLayout
# A Rolling Log File
log4j.appender.ROLLING1=org.apache.log4j.RollingFileAppender
log4j.appender.ROLLING1.File=test.log
#log4j.appender.ROLLING1.MaxFileSize=3KB # Just for demo purposes. Use bigger number IRL
log4j.appender.ROLLING1.MaxBackupIndex=3
log4j.appender.ROLLING1.layout=org.apache.log4j.TTCCLayout
What happens now is that the content is output to console, but not to the file (test.log, in this case).
What am I doing wrong?
TIA
~PT