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

正常的日志目录应该是/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

参考

posted @ 2016-05-16 21:22  peng_gy  阅读(167)  评论(0编辑  收藏  举报