Le 24/06/2020 à 03:33, Brian a écrit :

> To be honest with you, I'm happy about the catalina.out file finally getting 
> created and I really appreciate your kind help, I really do. But I'm not 
> really happy about having to restart rsyslog before every time I need to 
> restart Tomcat. It is weird, and I guess a lot of users will never imagine 
> that they have to do that and they will not feel very pleased when they 
> realize that the catalina.out file doesn't get created after restarting 
> Tomcat. And probably most of them will not even notice that the Tomcat log is 
> being added to the syslog, for that matter. This whole new relation between 
> syslog and Tomcat is really weird and I don't think the users are being 
> warned about it. I have used Tomcat+Ubuntu for several years and I haven't 
> seen this complication before. If there is an advantage about this relation 
> between syslog and Tomcat, I really can't see it. 

This is weird I fully agree, and I'll try do to something better.

There is a way to write to catalina.out without using rsyslogd, it's
possible to instruct systemd to write the process output directly to the
file by overriding the StandardOutput directive of the service file:

  StandardOutput=file:/var/log/tomcat9/catalina.out

This would go in a /etc/systemd/system/tomcat9.service.d/override.conf
file for example.

The downside is that you can no longer access the Tomcat output with
'journalctl -t tomcat9', nor see the last lines of the log when
displaying the status with 'systemctl status tomcat9'.

Ideally systemd should support writing to the journal and to a file
simultaneously, with something like StandardOutput=journal+file:... If
there is no other way to achieve the same result I'll file an
enhancement request on systemd.

Emmanuel Bourg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to