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.
相关问题
- Tomcat and SSL Client certificate
- Infinite setStatus() loop when requesting a JSF pa
- Can't configure nginx as a proxy for tomcat wi
- Tomcat 8 how to remove sessionCookieName from URL
- tomcat websocket servlet listening port
相关文章
- Tomcat的User信息可以存储到数据库中吗?
- tomcat的server.xml支持从Oracle中获取数据吗?
- web项目,Resonse Header发生解析错误,请大牛帮忙看看究竟是哪里的问题?
- Apache+Tomcat+JK实现的集群,如果Apache挂了,是不是整个服务就挂了?
- linux环境部署jpress,创建数据库时提提示连接失败
- Making a two way SSL authentication between apache
- Can't start Tomcat as Windows Service
- How to abort Tomcat startup upon exception in Serv
The log4j-scribe-appender project contains a Log4JAccessLogValve that will let you do just that.
if you using Tomcat 7, you can extend the AccessLogValve by override this function:
This works for JDK-logging:
pom.xml
Just compile, make a jar, put a copy in
/usr/share/tomcat7/lib/
, and modifyserver.xml
. I added it to my reference tomcat7 configuration on github.