Bug#448823: tomcat5.5: syslog messages have extra timestamp

David Pashley david at davidpashley.com
Thu Nov 1 10:10:33 UTC 2007


On Nov 01, 2007 at 09:21, Marcus Better praised the llamas by saying:
> > > The messages in question are those sent to stdout/err by Tomcat. They
> > > init script tells jsvc to send those to the syslog.
> >
> > A better solution would be to send stdout and stderr to
> > /var/log/tomcat5.5/catalina.{out,err}
> 
> The reasoning behind that setup is that Tomcat uses stdout/err for daemon 
> startup and shutdown messages, and on Debian such messages are nearly always 
> sent to daemon.log. So I would rather keep it this way.
> 
> The user can always change the init script to send those messages elsewhere.

Maybe set it in /etc/default/tomcat5.5
> 
> > and ship with a log4j file that 
> > sends tomcat logging to a file, say /var/log/tomcat5.5/tomcat.log,
> 
> The default setup splits the logs for each app to a separate file. Do you mean 
> those should be merged into one log file only?

I mean anything from tomcat itself should be sent to a separate logfile,
so that pretty much nothing is sent to stdout/stderr. 
> 
> I agree that something could be done about the rotation. The datestamps are 
> just irritating since they interfere with tab completion. Can we just remove 
> the datestamps, and have logrotate do the rotation? (Provided it doesn't 
> require server restart, that would be bad.)
> 
We could probably use logrotate. As I understand it, log4j opens the
logs files every time. The only problem is the stdout/stderr files,
which by their very nature can't be rotated without restarting tomcat.

I see the following:

Fatal start up errors (and people stupid enough to use
System.out.println -> syslog or catalina.{out,err}. This should be very
rarely used.

Tomcat core code -> tomcat.log

$app code -> $app.log

Using logrotate would solve the problem of log files building up over
time. Also, it would mean they would get compressed.

-- 
David Pashley
david at davidpashley.com
Nihil curo de ista tua stulta superstitione.





More information about the pkg-java-maintainers mailing list