Jetty 提供 NCSARequestLog 来记录请求。但这似乎默认每天都会滚动。
是否可以选择按小时进行滚动?
或者有没有办法为此提供自定义日志附加程序?
Jetty provides the NCSARequestLog to log the requests. But this seems to rollover on a daily basis by default.
Is there an option to have this rollover on an hourly basis?
Or is there a way to provide a custom log appender for this?
我不是 100% 确定您的滚动到底是什么意思,但我看到有两件事值得尝试:
查看 retainDays 设置,以定义何时可以删除旧日志。 wiki.eclipse.org/Jetty/Howto/Configure_Request_Logs
retainDays
请设置文件名 将文件名模板设置为特定于时间的内容:
<文件名>target/yyyy_mm_dd_hh.request.log 10 <附加>true <扩展>真 GMT+1
如果这有效,请反馈,因为我没有明确尝试过。
I am not 100% sure what exactly you mean with rollover, but I see two things worth trying:
Look at the retainDays setting, to define when old logs may be delted. wiki.eclipse.org/Jetty/Howto/Configure_Request_Logs
Tyr to set the filename template to something that is hour-specific:
<requestLog implementation="org.mortbay.jetty.server.NCSARequestLog"> <filename>target/yyyy_mm_dd_hh.request.log</filename> <retainDays>10</retainDays> <append>true</append> <extended>true</extended> <logTimeZone>GMT+1</logTimeZone> </requestLog>
Please feedback, if this works, since I didn't explicitly try it.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(1)
我不是 100% 确定您的滚动到底是什么意思,但我看到有两件事值得尝试:
查看
retainDays
设置,以定义何时可以删除旧日志。 wiki.eclipse.org/Jetty/Howto/Configure_Request_Logs请设置文件名 将文件名模板设置为特定于时间的内容:
如果这有效,请反馈,因为我没有明确尝试过。
I am not 100% sure what exactly you mean with rollover, but I see two things worth trying:
Look at the
retainDays
setting, to define when old logs may be delted. wiki.eclipse.org/Jetty/Howto/Configure_Request_LogsTyr to set the filename template to something that is hour-specific:
Please feedback, if this works, since I didn't explicitly try it.