-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Nashrul,
nashrul wrote: | Hi all, I'm a beginner to web application [and log4j isn't working for me]. [snip] | I also created log4j.properties file in <web-app>/WEB-INF/classes directory. | It contains the following [configuration]: | | log4j.logger.solmit=ALL, A | log4j.logger.org.apache=OFF, A | | log4j.appender.A=org.apache.log4j.ConsoleAppender | log4j.appender.A.layout=org.apache.log4j.PatternLayout | log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n | | | I packaged this application into WebTest.war. | When I dropped this package into my Tomcat (Tomcat 5.5), and tried to access | web app using this url :http://localhost:8080/WebTest/start-web-test | I got error messages on my stderr_20080522 log: | | log4j:WARN No appenders could be found for logger | (org.apache.catalina.startup.Embedded). | log4j:WARN Please initialize the log4j system properly. This means that log4j was asked to log a message before the logging system was initialized. IIRC, log4j is supposed to automatically configure itself on first-use by looking for log4j.properties in the classpath, but that does not appear to be happening, here. I recall having the same problem on several of our projects, and we simply added this to our initialization listener: ~ new org.apache.log4j.PropertyConfigurator(); This forces log4j to initialize itself using a properties file, and it will search the classpath for it -- so placing your log4j.properties file in WEB-INF/classes is appropriate. | Oh, I've also dropped log4j-1.2.13.jar and commons-logging-1.0.4.jar on | Tomcat/common/lib Do not do that. Remove those files from common/lib and anywhere else you tried putting them. Just use WEB-INF/lib in your own application for log4j.jar and commons-logging (if you actually need commons-logging). - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkg1dj8ACgkQ9CaO5/Lv0PDbqgCgouMNS+GuLE/a2qsP/u5/sCV8 494AnRMbIfdxLyY8MZoQz8p3r2Yufy7u =kSFm -----END PGP SIGNATURE----- --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]