Search code examples
tomcattomcat7tomcat-valve

Tomcat access logging through log4j?


I have a clean tomcat7 installation with log4j enabled (according to http://tomcat.apache.org/tomcat-7.0-doc/logging.html#Using_Log4j). "Application-level" logging do use log4j configuration (I direct logs to local syslog server). How can I make my application access.log to also use log4j? As far as I can see, I can choose among AccessLogValve, ExtendedAccessLogValve and JDBCAccessLogValve, but neighter of them enables me to log to syslog nor to use log4j.


Solution

  • The log4j-scribe-appender project contains a Log4JAccessLogValve that will let you do just that.