Can only get the rootLogger to work for Log4j
442015Apr 13 2005 — edited Apr 14 2005Hi!
I'm only able to get the root logger to work for Log4j. Because this log gets filled up quite fast I've set the log level to ERROR. On all the other loggers i use DEBUG level, but only the root log gets created.
To information I'm using exact the same setup in a NetBeans project (running on Tomcat) and it works just fine.
From what I can tell, Log4j is not able to read the log4j.properties file for these loggers.
My setup in JDeveloper:
1. I've added the log4j-1.2.9.jar file to the WEB-INF/lib folder and added this library to both the Model and the ViewController prosjects.
2. I've added a log4j.properties file to the all /src and /classes folders (to make sure the class loader can read the file).
Sample from the log4j.properties file:
log4j.rootLogger=error, root
log4j.appender.root=org.apache.log4j.DailyRollingFileAppender
log4j.appender.root.File=/var/logs/InsightNO-root.log
log4j.appender.root.DatePattern='.'yyyy-MM-dd
log4j.appender.root.layout=org.apache.log4j.PatternLayout
log4j.appender.root.layout.ConversionPattern=%d - %5p (%F:%L) - %m%n
log4j.logger=debug, viewController
log4j.appender.viewController=org.apache.log4j.DailyRollingFileAppender
log4j.appender.viewController.File=/var/logs/InsightNO-viewController.log
log4j.appender.viewController.DatePattern='.'yyyy-MM-dd
log4j.appender.viewController.layout=org.apache.log4j.PatternLayout
log4j.appender.viewController.layout.ConversionPattern=%d - %5p (%F:%L) - %m%n
log4j.logger=debug, caseAppModule
log4j.appender.caseAppModule=org.apache.log4j.DailyRollingFileAppender
log4j.appender.caseAppModule.File=/var/logs/InsightNO-caseAppModule.log
log4j.appender.caseAppModule.DatePattern='.'yyyy-MM-dd
log4j.appender.caseAppModule.layout=org.apache.log4j.PatternLayout
log4j.appender.caseAppModule.layout.ConversionPattern=%d - %5p (%F:%L) - %m%n
....
I feel I've tried everything now but I'm not getting more than the root logger to work. I'm not getting any error messages either to give me a hint of what is wrong.....please help.
Cheers,
Peter