-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Brian,
On 6/22/20 02:04, Brian wrote: > Hello, > > I have been using Tomcat for about 18 years. As far as I can > remember, everything that I leave on the log with > System.out.println() has been found inside the file "catalina.out" > which has been nice. However, this seems to have changed. I just > migrated to Ubuntu 20.04 + Tomcat 9.0.31, and installed Tomcat > doing a "sudo apt install tomcat9". Now I see that the file > "catalina.out" never gets created, and that everything that had > been sent there is now being sent to the Ubuntu/Linux/Debian log > "syslog". I don't like that, I want to keep having a > separate/dedicated log for Tomcat (which is something I check very > often) and not havoing to search for it inside syslog (which is > something I rarely inspect). > > I have done some research, and this is what I have discovered (if I > understood everything correctly): > > - Tomcat now runs as a service inside something called "systemsd" - > For some reason, the people at Ubuntu/Debian/Linux decided that > Tomcat's log should be found inside syslog, instead of staying > independent inside "catalina.out". Why is that? I don't know and I > don't like it! - The other files inside /var/log/tomcat get > created, including the "catalina.YYYY-MM-DD.log" files. But I dont' > find my "System.out.println()" messages there, which has always > been the case. - I have found, however, that syslog tries to create > and populate the "catalina.out" file as well, since I have found an > error inside syslog that says something like "rsyslogd: file > '/var/log/tomcat9/catalina.out': open error: Permission denied". - > I have also found a file "/etc/rsyslog.d/tomcat9.conf" which, > indeed, seams to indicate syslog that the file > "/var/log/tomcat9/catalina.out" must be populated. Which makes > sense and should solve my needs. - Considering the "Permission > denied" error message, I started playing with the permissions > (something that I really don't have much experience with). If I > remember correctly, I created the file "catalina.out" manually, and > the modified its properties so the owners are "tomcat/adm", since > the "syslog" process/user seems to be inside the "adm" group. > Restarted everything... and the "catalina.out" file got created and > populated!!! So it seems that the main obstacle here is a lack of > correct permissions so syslog can do what has been told and > populate the "catalina.out" file. Did I get it right? - However, > when I delete all the log files (which I do every once in a while), > the permissions that I assigned get lost and the file doesn't get > created anymore. > > What are we supposed to do to deal with this problem? Can/should we > do something so the Tomcat log doesn't go to syslog? If not, and > considering that it seems that syslog is trying to populate the > "catalina.out" file as it has been told, what should we do to > correct the permissions problem? What are the permissions of the /var/log/tomcat directory? Perhaps you need to chmod g+w /var/log/tomcat ? - -chris -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl7w0hUACgkQHPApP6U8 pFgABA/7BwxNOI313uSbRMSFPpdilpxhTkmujrvcit+A8lpre0hSNOUw2Q6i38L6 uT536ff2TwrFoizfEz/ydEW8lZQoEOWejlXPU8eO3/ehi7Gpat645+a559rCjr3m S5vfKw1UqrjKQXkeSlFGH1SFaKJfEnSKyjeH+/5yWVTL0z4G6Zatt9iZyUdHbPKh cuTrSpgfuOlsPdqKvO/7Y7gWoLqb52+17gawN6rrviRHs6U1S9EIgTWk0of1JYe/ K2l2ob9DfuVJCW+byL5FPE0AEwzyWMfh1W1yEMRGJKsUHFv+5BaXXRyc/yh9/E/l vqf+7OJPJ2V5Kp9KasX6NxBiyCGxH910lfyooeEIRAYmiWx61FD6OTcrklm5boEN fT7KyeuujIhnQSIq+c+0rKX+t2DtyQCuqP/e5SFiUt4WL4xH85e5FaoExk2ZlOoP E5phuijWPJakSTiXBG4cKRQyFqzLVqHSl6VbCHEzbj6rDHaiqOW0Wqs+Z2OV5q1k c7vMiHbawiqlo+5NzB/kVG+HISMQvK0lmuLsZOUaGFv2E5L85UuQhp2KLD01j0AF iEizODrxbs3AVs3+jx/LM6mXhqb6oCq93DLbWwuV0mhOTX6Dj1VxqkSUUiyyElD5 bCFl5dfyc0gc+daEAj32gshL9MBDPCkkyvBKO/N3Wdy2YnLP4GM= =ltDw -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org