简体   繁体   English

如何在 WSO2 中指定创建日志 http_access 的时间?

[英]How to specific time for Logs creation http_access in WSO2?

From this docs https://is.docs.wso2.com/en/5.9.0/setup/http-access-logging/ said about log creation will rotate on daily basis.从这个文档https://is.docs.wso2.com/en/5.9.0/setup/http-access-logging/说日志创建将每天轮换。 So, the new log should be created around midnight everyday.因此,新日志应在每天午夜左右创建。

However, I've noticed that my WSO2 http_access logs in directory /wso2am/repository/logs have been creating by random time.但是,我注意到目录 /wso2am/repository/logs 中的 WSO2 http_access 日志是随机创建的。

-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

besided, I've set parameters buffered=false , and backgroundProcessorDelay="1" as mentioned here Tomcat HTTP Access log has a delay in writing to the file still no luck!此外,我已经设置了参数buffered=falsebackgroundProcessorDelay="1"正如这里提到的Tomcat HTTP 访问日志在写入文件时有延迟仍然没有运气!

my Valves class setting in catalina-server.xml我在 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 &quot;%r&quot; %s %b %T"/>

The time you see with the "ls" command is the last updated time of the file.您使用“ls”命令看到的时间是文件的最后更新时间。 So you have not received any requests to the server after the shown time each day.因此,在每天显示的时间之后,您还没有收到对服务器的任何请求。 It should not have any impact on the file created time and you should not have any data inconsistencies in the log file.它不应对文件创建时间产生任何影响,并且日志文件中不应存在任何数据不一致的情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM