【发布时间】:2021-01-30 13:46:38
【问题描述】:
从这个文档https://is.docs.wso2.com/en/5.9.0/setup/http-access-logging/ 说关于日志创建将每天轮换。因此,应该在每天午夜左右创建新日志。
但是,我注意到我的 WSO2 http_access 日志在目录 /wso2am/repository/logs 一直在随机创建。
-rw-r--r-- 1 wso2 wso2 314 Oct 11 21:50 http_access_2020-10-11.log
-rw-r--r-- 1 wso2 wso2 48416 Oct 12 16:58 http_access_2020-10-12.log
-rw-r--r-- 1 wso2 wso2 30075 Oct 13 15:51 http_access_2020-10-13.log
-rw-r--r-- 1 wso2 wso2 47476 Oct 14 12:53 http_access_2020-10-14.log
-rw-r--r-- 1 wso2 wso2 34975 Oct 15 17:54 http_access_2020-10-15.log
-rw-r--r-- 1 wso2 wso2 154 Oct 16 02:45 http_access_2020-10-16.log
此外,我已经设置了参数buffered=false 和backgroundProcessorDelay="1" 如此处提到的Tomcat HTTP Access log has a delay in writing to the file 仍然没有运气!
我在 catalina-server.xml 中的 Valves 类设置
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="${carbon.home}/repository/logs" buffered="false"
prefix="http_access_" suffix=".log" pattern="%h %l %u %t "%r" %s %b %T"/>
【问题讨论】:
-
尽管文件名中有时间戳,但我认为您今天的日志中没有昨天的记录,是吗?可能是服务器在
21:50上11th Oct之前没有收到任何请求。该文件将由日志阀创建,仅当它收到当天的日志请求时。
标签: linux tomcat logging wso2 wso2is