在我的Railo服务器上,日志文件在5 MB时旋转。我想增加那个大小,或者我想保留更多的logfile backkups。我怎么做?我错过了什么配置文件?
答案 0 :(得分:1)
据我所知,目前还没有这方面的用户界面,但他们有很多选择。
配置此功能的最佳方法是查看您网站的WEB-INF / railo-web.xml.cfm文件。在那里你可以看到一个块说:
<logging>
<logger .../>
</logging>
有很多选项,但对于logger appender =&#34; resource&#34; (即附加到文件),你可以在文件的内联评论中看到,目前说(在我的版本是Railo 4.2.0.007 beta)
Resource:
Logs error to a resource (locale file, ftp, zip, ...)
- path: path to the locale file
-charset (default:resource charset): charset used to write the file
- maxfiles (default:10): maximal files created
- maxfilesize (default:1024*1024*10): the maxial size of a log file created
因此,对于您的用例,您应该添加以下内容:
<logging>
<logger appender="resource" maxfilesize="5242880" appender-arguments="path:{railo-config}/logs/remoteclient.log" layout="classic" level="info" name="remoteclient"/>
<logger appender="resource" maxfilesize="5242880" appender-arguments="path:{railo-config}/logs/requesttimeout.log" layout="classic" name="requesttimeout"/>
<logger appender="resource" maxfilesize="5242880" appender-arguments="path:{railo-config}/logs/mail.log" layout="classic" name="mail"/>
<logger appender="resource" maxfilesize="5242880" appender-arguments="path:{railo-config}/logs/scheduler.log" layout="classic" name="scheduler"/>
<logger appender="resource" maxfilesize="5242880" appender-arguments="path:{railo-config}/logs/trace.log" layout="classic" name="trace"/>
<logger appender="resource" maxfilesize="5242880" appender-arguments="path:{railo-config}/logs/application.log" layout="classic" level="info" name="application"/>
<logger appender="resource" maxfilesize="5242880" appender-arguments="path:{railo-config}/logs/exception.log" layout="classic" level="info" name="exception"/>
</logging>
(我还没有测试过maxsize calc,所以你的milage可能会有所不同)