Log4j, Wicket, Tomcat, and NetBeans IDE
By Geertjan on Jul 02, 2005
- Stop the running Tomcat instance. (In the IDE's Runtime window.)
- Download Commons Logging and copy the JAR to Tomcat's common/lib folder.
- Download Log4j and copy the JAR to Tomcat's common/lib folder.
- Create a log4j.properties file in Tomcat's common/classes folder. Make sure it contains the following line:
The above line is only for the resource package. To enable debugging for all the Wicket packages, use this instead:
This is my log4j.properties file. Make sure that you change the log4j.appender.R.File property to point to logs/tomcat.log file in Tomcat's base directory (which is inside the NetBeans IDE user directory).
- Deploy the Wicket application. (In the IDE's Projects window.)
- Go to the logs/tomcat.log file in Tomcat's base directory and, if errors have been picked up, note that there are lines such as the following:
2005-07-02 20:41:25,140 [http-8084-Processor23] DEBUG wicket.util.resource.locator.ResourceStreamLocator - Attempting to locate resource 'wicket/examples/navomatic/Page1.html' on path [folders = [\\], webapppaths: ]
Finally, I've found this document to be very helpful in setting up Log4j for Tomcat: Logging for Apache Tomcat and Velocity using Log4j