Tomcat 9.如何将catalina.out传递到服务日志(journalctl)
我在 Centos 机器上使用 Tomcat 9。 Tomcat 应用程序的日志在 /opt/tomcat/logs.catalina.out 生成。有没有办法将这些日志传递到服务日志(journalctl -u MyTomcat.service -f)?
触发我的服务
我从 /etc/systemd/system.MyTomcat.service ExecStart=/opt/tomcat/startup.sh
(startup.sh 调用 catalina.sh start)我可以在 catalina.out 中看到日志,但 journcalctl 有只有这些行,但卡塔琳娜包括我的应用程序的所有日志记录
Feb 28 08:14:39 192.168.1.2 systemd[1]: Starting My Tomcat Service...
Feb 28 08:14:39 192.168.1.2systemd[1]: Started My Tomcat Service.
Feb 28 08:14:39 192.168.1.2tomcat[23222]: Tomcat started.
I'm using Tomcat 9 in a Centos machine. The logs from Tomcat applications are generated at /opt/tomcat/logs.catalina.out. Is there a way to pass these logs to service logs (journalctl -u MyTomcat.service -f)?
I trigger my service from /etc/systemd/system.MyTomcat.service
ExecStart=/opt/tomcat/startup.sh (startup.sh call catalina.sh start)
I'm able to see the logs in catalina.out but journcalctl has only these rows but catalina includes all the logging from my apps
Feb 28 08:14:39 192.168.1.2 systemd[1]: Starting My Tomcat Service...
Feb 28 08:14:39 192.168.1.2systemd[1]: Started My Tomcat Service.
Feb 28 08:14:39 192.168.1.2tomcat[23222]: Tomcat started.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您好,我找到了该帖子的解决方案。如果还有其他人正在寻找它,这就是我所做的。
Hi i found a solution for the post. Here is what I did if there is someone else that is looking for it.