tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Using CentOS 7 logrotate
Date Tue, 19 Dec 2017 16:39:37 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Lance,

On 12/19/17 10:30 AM, Campbell, Lance wrote:
> Tomcat 8.0.x CentOS 7 1) Is there a way to tell tomcat to put the
> logs for a running instance into /var/log/{somefoldername}/

Sure. Just change the paths of the log files to /var/log/somewhere.
Note that writing to /var is usually not allowed except by root-owned
processes, and running Tomcat as root as a Bad Idea.

You should also set CATALINA_OUT to point to
/var/log/somewhere/catalina.out as well. Set this in
CATALINA_BASE/setenv.sh.

> 2) Then have CentOS 7 logrotate take care of the rotation of the
> files?

Yes. Just configure logrotate as usual.

However:

1. Most Tomcat log files can rotate themselves quite well.
2. catalina.out is a special case because it's a redirected-stdout, so
you'll have the usual caveats about those kinds of things with
logrotate. I'd recommend either using copy+truncate or hack
catalina.sh to pipe stdout through a logger that supports rotation,
such as rotatelogs.

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQJRBAEBCAA7FiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlo5QMkdHGNocmlzQGNo
cmlzdG9waGVyc2NodWx0ei5uZXQACgkQHPApP6U8pFhLVhAAyCYv+jA3SD59gEJb
+AHRtdc6C6CAkvcA9vwpxllqKTBfsW/Ojc1tq2wx+bVMa4c0qbY3SaZm05tcqcke
GXd+/Dx5ve0OdEKYcHk6VobOird5EAIdDvlE2DchgTT7x2r5/CocqAm3Gq4giFkU
fMESqm/BWG6S+Yt7I/v1LTumgPRwkKO13yYin9A4qEen2T6jb7wMx2NzfT8hWof0
XCiUbFQ7npC/vzkolmHaee+WXiuDih/FMFD1hfGm6wLLIW24V8H1eh6yXuNWJ/3O
tK1nHsTwYgRXnZroBQIEfHOGqSrcieDTxNbWdwfS+4E1GwmInDE/i5gIhtlQGAAd
9QAZL9IK75lG1K2TMj1peCXjEoShX2XolnpfkRxBxP0V2CAlPvTxlDGdWBdRPox2
I6y+XvyfbH83Ujxw6DiqfJckvcx2nFjC0oT92kRAxWtUnDaa2PJqcqSGS0deP7lg
eKMGbKSwepdRgG7yId54s0+bQtdYIjzT2EhKsu/MbBRXbQfnxa6c50S2Bdv7FyLi
+vQgaUJe0HCKv6wBtv2X16irS5AadruL5/mLse7BZs1jzTjXOrtwn9MQrAdMA6u8
I/OLKZH61AWkiTMcOm1AjvHFVDV828lv1IH1n41JW8SsFwpHBX91oBUibEBycGYf
M2ncrPx+3zxJwj6L9JN96wU5mCg=
=rOMs
-----END PGP SIGNATURE-----

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


Mime
View raw message