-----Original Message-----
From: Emmanuel Bourg <ebo...@apache.org>
Reply-To: Tomcat Users List <users@tomcat.apache.org>
Date: Tuesday, June 23, 2020 at 20:01
To: "users@tomcat.apache.org" <users@tomcat.apache.org>
Subject: Re: File "catalina.out" not being created/populated when using Tomcat 
9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?

    Le 24/06/2020 à 02:35, Brian a écrit :

    > Good news: I updated "/etc/tmpfiles.d/tomcat9.conf" (the file I created) 
with the new value of 2770. Deleted all the logs inside "/val/log/tomcat9" and 
restarted Ubuntu. "catalina.out" got created and populated.
    > Bad news: Then I deleted all the logs inside "/val/log/tomcat9" and just 
restarted Tomcat (which is something I do sometimes, in production). 
"catalina.out" didn't get created this time.
    > Just to confirm, again I deleted all the logs inside "/val/log/tomcat9" 
and restarted Ubuntu. "catalina.out" got created and populated again.
    > Any ideas?

    The catalina.out file is held by rsyslogd and isn't recreated unless you
    restart rsyslogd. Try this when you clean the logs and restart Tomcat:

      systemctl restart rsyslog tomcat9


I just realized that when the "bad news" experiment took place, in the syslog 
there was NOT another of those " file '/var/log/tomcat9/catalina.out': open 
error: Permission denied.." errors, so I guess it was not a permissions issue 
anymore, which makes me think that the "2770" value finally solved that issue. 
That is nice, thanks!
OK, I restarted rsyslog and the started again Tomcat as you adviced and... you 
are right, the catalina.out file got created again. So I think you are right 
about rsyslogd still holding the log file.

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. 

Thanks again!


Reply via email to