You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Chris Cheshire <ya...@gmail.com> on 2019/11/01 15:25:36 UTC
catalina_out env var
(Tomcat 9, Debian & Centos Unix)
I use systemd to start tomcat with base and home separated using
catalina.sh. For the service script, values for JAVA_HOME,
CATALINA_HOME, CATALINA_BASE and CATALINA_OUT are defined there.
Inside catalina.sh it says this about CATALINA_OUT
# CATALINA_OUT (Optional) Full path to a file where stdout and stderr
# will be redirected.
# Default is $CATALINA_BASE/logs/catalina.out
If this isn't defined, catalina.sh sets a default. It seems that
everything that goes in here also goes in catalina.date.log
(controlled by the tomcat's logging.properties), so why does it exist?
Can I force a redirection to /dev/null instead so I don't have
duplicated logs?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: catalina_out env var
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Chris,
On 11/1/19 11:25, Chris Cheshire wrote:
> (Tomcat 9, Debian & Centos Unix)
>
> I use systemd to start tomcat with base and home separated using
> catalina.sh. For the service script, values for JAVA_HOME,
> CATALINA_HOME, CATALINA_BASE and CATALINA_OUT are defined there.
>
> Inside catalina.sh it says this about CATALINA_OUT
>
> # CATALINA_OUT (Optional) Full path to a file where stdout and
> stderr # will be redirected. #
> Default is $CATALINA_BASE/logs/catalina.out
>
> If this isn't defined, catalina.sh sets a default. It seems that
> everything that goes in here also goes in catalina.date.log
> (controlled by the tomcat's logging.properties), so why does it
> exist?
They aren't strictly duplicated.
The file used in CATALINA_OUT will catch stdout+stderr of the process.
That includes things like System.out.print() and System.err.print().
By default, Tomcat's error loggers are configured to write to
stdout/stderr but those can be reconfigured to do other things.
stdout is always stdout, and stderr is always stderr, though.
For example, if you use "kill -3" to get a thread dump, it will never
go to catalina.date.log because it doesn't go through any logging
facility.
> Can I force a redirection to /dev/null instead so I don't have
> duplicated logs?
You *can* do this, but you might miss some things. If you think
catalina.out is chatty, you might want to adjust logging.properties to
stop logging to the console.
- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl28b8YACgkQHPApP6U8
pFimxBAAxqzv3XGMb6gkcNFDnqAsMAx3vvIfmrEtWC8JpWr0O6ao0a+KI/WkeF3n
kgNuyRDvFWbCH67c9qxThXs+cDToTUZNOjeTb/OcgIScf/PbWGe1vGCdQ04SWpKQ
m3O7yTfUjnfa/VYB2L93Bzf3EVHUbhjmKrhHV7XCO358FqQNmgXdBEEWC3NB4ns0
/xqqgWxj3v9LCc1GtQ6DUiblm91WUyEFzzy9lSxCAHcarYFvXnBApodganDbfbVt
eJ/hHy68vjcIvryJ2AgGJvMY97lc0mmS3EuYZeaTFM9VHDm2wnOpEvckk5fkcZzL
pnmK1+j9RJXXKwcQPTO2FOSyOdIoTGf0pdMpGOyHlUY6cy6RcwYeHOUfCK19y28t
npfRYywOJIkphnFm4u0/etEuggn9wIQKnMLJYO9n0ei9Rp8P4ESYuXUq3QrzIvQM
czUCL9Vtl8ahgghNb+60LEuMtnVYDwcSsFdCV3bldxefOYrRvG7eP4taEFIxhV/W
dEWz9btxfbejZFQpNUQQfPy3rAPy4I6sGww/EZN7o6d66jzanergjk9FOWeQ4rSx
yDkU2/CoTppjaKofWzVB36V43kx/fdG48QOFeZ3dHCxEHzTmEyc8Vv0WEqMDv9ga
suWczx3WtOUyhbRLHWitSO3voqufoVRWY7Fl+YcPW21UHMiU21g=
=eJW1
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: catalina_out env var
Posted by Chris Cheshire <ya...@gmail.com>.
On Fri, Nov 1, 2019 at 1:59 PM Mark Thomas <ma...@apache.org> wrote:
>
> On November 1, 2019 3:25:36 PM UTC, Chris Cheshire <ya...@gmail.com> wrote:
> >(Tomcat 9, Debian & Centos Unix)
> >
> >I use systemd to start tomcat with base and home separated using
> >catalina.sh. For the service script, values for JAVA_HOME,
> >CATALINA_HOME, CATALINA_BASE and CATALINA_OUT are defined there.
> >
> >Inside catalina.sh it says this about CATALINA_OUT
> >
> ># CATALINA_OUT (Optional) Full path to a file where stdout and
> >stderr
> ># will be redirected.
> ># Default is $CATALINA_BASE/logs/catalina.out
> >
> >If this isn't defined, catalina.sh sets a default. It seems that
> >everything that goes in here also goes in catalina.date.log
> >(controlled by the tomcat's logging.properties), so why does it exist?
> >Can I force a redirection to /dev/null instead so I don't have
> >duplicated logs?
> >
>
> You can control this in logging.properties Just disable the console logger.
>
> You don't want redirect to /dev/null as then you will be unable to take thread dumps or anything else that writes to stdout.
>
> It is setup this way for users running Tomcat directly from the console.
>
> Mark
>
OK so I just remove java.util.logging.ConsoleHandler from the
.handlers line? Does this affect the content of catalina.log, or
catalina.date.log?
I'm less concerned about the chattiness than the redundancy. I've got
two logs that contain the same thing, one I have to control with
logrotate.d and the other automatically rotates but is never cleared
so I also need a cron job to remove old logs. I'm just trying to clean
things up.
Thanks
Chris
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: catalina_out env var
Posted by Mark Thomas <ma...@apache.org>.
On November 1, 2019 3:25:36 PM UTC, Chris Cheshire <ya...@gmail.com> wrote:
>(Tomcat 9, Debian & Centos Unix)
>
>I use systemd to start tomcat with base and home separated using
>catalina.sh. For the service script, values for JAVA_HOME,
>CATALINA_HOME, CATALINA_BASE and CATALINA_OUT are defined there.
>
>Inside catalina.sh it says this about CATALINA_OUT
>
># CATALINA_OUT (Optional) Full path to a file where stdout and
>stderr
># will be redirected.
># Default is $CATALINA_BASE/logs/catalina.out
>
>If this isn't defined, catalina.sh sets a default. It seems that
>everything that goes in here also goes in catalina.date.log
>(controlled by the tomcat's logging.properties), so why does it exist?
>Can I force a redirection to /dev/null instead so I don't have
>duplicated logs?
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
You can control this in logging.properties Just disable the console logger.
You don't want redirect to /dev/null as then you will be unable to take thread dumps or anything else that writes to stdout.
It is setup this way for users running Tomcat directly from the console.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org