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

參考

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章