tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George Sexton" <>
Subject RE: Clearing the catalina.out file
Date Fri, 14 Aug 2009 18:42:13 GMT

> -----Original Message-----
> From: Christopher Schultz []
> Sent: Friday, August 14, 2009 10:59 AM
> To: Tomcat Users List
> Subject: Re: Clearing the catalina.out file
> Hash: SHA1
> George,
> On 8/14/2009 12:48 PM, George Sexton wrote:
> > Logrotate isn't going to work because the file is never re-set.
> > Typically, when you use LogRotate with something like apache you send
> > a command to re-start it.
> Sure it will. Check the "copytruncate" option.

That's an interesting option. It seems fraught with danger, but I tested it and it does work.

> > So, if you want to reset catalina.out you need to re-start tomcat.
> No, you don't. Why do people make statements like this? You can try it
> yourself. It takes like 5 seconds:
> $ bin/
> (observe log file with messages)
> $ > logs/catalina.out
> (observe empty log file)
> (redeploy an application, or do something that will generate output in
> catalina.out)
> (observe new messages in catalina.out)
> What part of that doesn't work?
> - -chris

The part about new data appearing. On one of my production servers, I erased catalina.out.
I then invoked a JSP that generated output to system.out. The file catalina.out did not magically
appear. No data was magically written to the file. I went into proc for the PID for JSVC,
and looked at the File Descriptors. Sure enough, if I look in the FD directory, FD 1 shows
deleted. If I examine the contents of the file descriptor, the test data is appended to the
end of the file.

It doesn't work. I make these statements because I know what I observe. I've also been using
Linux since something like 1997 so I've got a fair amount of experience there too.

Perhaps we observe different results because I'm using JSVC.

George Sexton
MH Software, Inc.
Voice: 303 438 9585

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message