Archives: Logging

Java Struts – Logging with Log4j Example

Download Log4j: http://logging.apache.org/log4j/index.html

Log4j Appender:
Create a Log4j properties file (log4j.properties) and define the appender details (where to log and log file details). And put the log4j.properties into your project classpath.

log4j.properties

Struts Action Class:

Struts Custom Exception Handler:

Log4j Output File Sample- c:\\logging.log


Java Servlet – Logging with Log4j Example