Why Tomcat7 is replicating all my logs in /var/log/messages

来源:互联网 发布:螺纹梳刀编程 编辑:程序博客网 时间:2024/06/05 19:12

正常的日志目录应该是/var/log/tomcat,而在tomcat7当中日志全都跑到/var/log/messages当中了。

原因及解决方法:

Tomcat when used with official Arch Linux packages uses systemd's journalctl for startup log. This means that files /var/log/tomcat7/catalina.err and /var/log/tomcat7/catalina.out are not used. Other logs such as access logs and business logs defined in /etc/tomcat7/server.xml as Valve will still by default end up in /var/log/tomcat7/.To restore upstream style logging, copy systemd file /lib/systemd/system/tomcat7.service to /etc/systemd/system/tomcat7.service and change both SYSLOG for the absolute paths of log files.

所以将/lib/systemd/system/tomcat.service
copy至/etc/systemd/system/tomcat.service

参考

0 0