In tomcat http access log valve takes some time to write to file. Please note I have default configurations for org.apache.catalina.valves.AccessLogValve. Are there anyways to improve the latency? And what are the key reasons for this delay
相关问题
- I want to trace logs using a Macro multi parameter
- Tomcat and SSL Client certificate
- Error message 'No handlers could be found for
- convert logback.xml to log4j.properties
- Django management command doesn't show logging
相关文章
- Tomcat的User信息可以存储到数据库中吗?
- tomcat的server.xml支持从Oracle中获取数据吗?
- web项目,Resonse Header发生解析错误,请大牛帮忙看看究竟是哪里的问题?
- Apache+Tomcat+JK实现的集群,如果Apache挂了,是不是整个服务就挂了?
- linux环境部署jpress,创建数据库时提提示连接失败
- how do I log requests and responses for debugging
- Making a two way SSL authentication between apache
- Android Studio doesn't display logs by package
I found the answer for this. You can improve the delay by disabling buffering. Flag "buffered" determine if logging will be buffered. If set to false, then access logging will be written after each request. Default value: true. Therefore, adding BufferedLogs="false" will reduce the delay in writing to the log file. Another property is backgroundProcessorDelay. If not specified, the default value for this attribute is 10, which represent a 10 seconds delay. Therefore, by setting it to a lower value you can improve the delay writing http-access logs to a file.
the main reason is tomcat buffered the log message . we can disabled the buffer by changing the logger's default behaviors . we can find in $TOMCAT_HOME/conf/server.xml
tomcat version : tomcat-7.0.61
by setting buffered attribute to false , we can get the access information immediately. doc of AccessLogValve