Re: Rotating catalina.out with Webmin
if you dont get webmin fixed, I recommend cronolog instead. You cant just rotate it, cause then tomcat loses the file handle, and you will lose all further output. with cronolog you simply pipe it through cronolog like this your java start command | /usr/local/sbin/cronolog $CATALINA_BASE$/logs/%Y-%m-%d.catalina.out /dev/null 21 this will rotate the logs daily Filip - Original Message - From: Carlos [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 15, 2004 2:05 PM Subject: Rotating catalina.out with Webmin Hi Forum, Could someone recommend settings for using the log rotation of Webmin in order to rotate catalina.out (any cautionary measures)? I just created an entry in Webmin to rotate the catalina.out file weekly with all the default settings (keeping the last four copies). Are there any scripts I should run before or after the rotation is carried out? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Rotating catalina.out with Webmin
Hi, As usual, the advice is also to minimize System.out logging. If you can't modify the app code using System.out logging, add swallowOutput=true to your context declaration to make System.out go to the Loggers defined in Tomcat's server.xml. Those are automatically rotated for you. (Note this all applies to Tomcat 5.0.x and older, not to 5.5 and newer) Yoav Shapira http://www.yoavshapira.com -Original Message- From: Filip Hanik - Dev [mailto:[EMAIL PROTECTED] Sent: Monday, November 15, 2004 3:19 PM To: Tomcat Users List Subject: Re: Rotating catalina.out with Webmin if you dont get webmin fixed, I recommend cronolog instead. You cant just rotate it, cause then tomcat loses the file handle, and you will lose all further output. with cronolog you simply pipe it through cronolog like this your java start command | /usr/local/sbin/cronolog $CATALINA_BASE$/logs/%Y-%m-%d.catalina.out /dev/null 21 this will rotate the logs daily Filip - Original Message - From: Carlos [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 15, 2004 2:05 PM Subject: Rotating catalina.out with Webmin Hi Forum, Could someone recommend settings for using the log rotation of Webmin in order to rotate catalina.out (any cautionary measures)? I just created an entry in Webmin to rotate the catalina.out file weekly with all the default settings (keeping the last four copies). Are there any scripts I should run before or after the rotation is carried out? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Rotating catalina.out with Webmin
Hi Filip, I set-up the Webmin Log Rotation entry to the following: 1) Re-create log file after rotation? Yes, with mode and owned by user and group 2) Store old rotated logs in Directory Same directory as log file Default (Same directory as log file) 3) Extension for rotated filenames Default Should not this maintain the file handle? -Original Message- From: Filip Hanik - Dev [mailto:[EMAIL PROTECTED] Sent: Monday, November 15, 2004 3:19 PM To: Tomcat Users List Subject: Re: Rotating catalina.out with Webmin if you dont get webmin fixed, I recommend cronolog instead. You cant just rotate it, cause then tomcat loses the file handle, and you will lose all further output. with cronolog you simply pipe it through cronolog like this your java start command | /usr/local/sbin/cronolog $CATALINA_BASE$/logs/%Y-%m-%d.catalina.out /dev/null 21 this will rotate the logs daily Filip - Original Message - From: Carlos [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 15, 2004 2:05 PM Subject: Rotating catalina.out with Webmin Hi Forum, Could someone recommend settings for using the log rotation of Webmin in order to rotate catalina.out (any cautionary measures)? I just created an entry in Webmin to rotate the catalina.out file weekly with all the default settings (keeping the last four copies). Are there any scripts I should run before or after the rotation is carried out? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Rotating catalina.out with Webmin
I found that logrotate is the easiest. -Original Message- From: Carlos Oliva [mailto:[EMAIL PROTECTED] Sent: November 15, 2004 3:28 PM To: 'Tomcat Users List' Subject: RE: Rotating catalina.out with Webmin Hi Filip, I set-up the Webmin Log Rotation entry to the following: 1) Re-create log file after rotation? Yes, with mode and owned by user and group 2) Store old rotated logs in Directory Same directory as log file Default (Same directory as log file) 3) Extension for rotated filenames Default Should not this maintain the file handle? -Original Message- From: Filip Hanik - Dev [mailto:[EMAIL PROTECTED] Sent: Monday, November 15, 2004 3:19 PM To: Tomcat Users List Subject: Re: Rotating catalina.out with Webmin if you dont get webmin fixed, I recommend cronolog instead. You cant just rotate it, cause then tomcat loses the file handle, and you will lose all further output. with cronolog you simply pipe it through cronolog like this your java start command | /usr/local/sbin/cronolog $CATALINA_BASE$/logs/%Y-%m-%d.catalina.out /dev/null 21 this will rotate the logs daily Filip - Original Message - From: Carlos [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 15, 2004 2:05 PM Subject: Rotating catalina.out with Webmin Hi Forum, Could someone recommend settings for using the log rotation of Webmin in order to rotate catalina.out (any cautionary measures)? I just created an entry in Webmin to rotate the catalina.out file weekly with all the default settings (keeping the last four copies). Are there any scripts I should run before or after the rotation is carried out? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] !DSPAM:4199117c52001195320907!
Re: Rotating catalina.out with Webmin
nope, the moment you execute the mv the file handle has moved. switch to cronolog to save you some time, cronolog might recreate the file for you to, so no handle is ever lost, try it before you come back to the list :) Filip - Original Message - From: Carlos Oliva [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Monday, November 15, 2004 2:28 PM Subject: RE: Rotating catalina.out with Webmin Hi Filip, I set-up the Webmin Log Rotation entry to the following: 1) Re-create log file after rotation? Yes, with mode and owned by user and group 2) Store old rotated logs in Directory Same directory as log file Default (Same directory as log file) 3) Extension for rotated filenames Default Should not this maintain the file handle? -Original Message- From: Filip Hanik - Dev [mailto:[EMAIL PROTECTED] Sent: Monday, November 15, 2004 3:19 PM To: Tomcat Users List Subject: Re: Rotating catalina.out with Webmin if you dont get webmin fixed, I recommend cronolog instead. You cant just rotate it, cause then tomcat loses the file handle, and you will lose all further output. with cronolog you simply pipe it through cronolog like this your java start command | /usr/local/sbin/cronolog $CATALINA_BASE$/logs/%Y-%m-%d.catalina.out /dev/null 21 this will rotate the logs daily Filip - Original Message - From: Carlos [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 15, 2004 2:05 PM Subject: Rotating catalina.out with Webmin Hi Forum, Could someone recommend settings for using the log rotation of Webmin in order to rotate catalina.out (any cautionary measures)? I just created an entry in Webmin to rotate the catalina.out file weekly with all the default settings (keeping the last four copies). Are there any scripts I should run before or after the rotation is carried out? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Rotating catalina.out with Webmin
Hi Phillip, Since Webmin uses logrotate could I just create a simple entry with Webmin? Or do I need to specify other settings? -Original Message- From: Phillip Qin [mailto:[EMAIL PROTECTED] Sent: Monday, November 15, 2004 3:31 PM To: 'Tomcat Users List' Subject: RE: Rotating catalina.out with Webmin I found that logrotate is the easiest. -Original Message- From: Carlos Oliva [mailto:[EMAIL PROTECTED] Sent: November 15, 2004 3:28 PM To: 'Tomcat Users List' Subject: RE: Rotating catalina.out with Webmin Hi Filip, I set-up the Webmin Log Rotation entry to the following: 1) Re-create log file after rotation? Yes, with mode and owned by user and group 2) Store old rotated logs in Directory Same directory as log file Default (Same directory as log file) 3) Extension for rotated filenames Default Should not this maintain the file handle? -Original Message- From: Filip Hanik - Dev [mailto:[EMAIL PROTECTED] Sent: Monday, November 15, 2004 3:19 PM To: Tomcat Users List Subject: Re: Rotating catalina.out with Webmin if you dont get webmin fixed, I recommend cronolog instead. You cant just rotate it, cause then tomcat loses the file handle, and you will lose all further output. with cronolog you simply pipe it through cronolog like this your java start command | /usr/local/sbin/cronolog $CATALINA_BASE$/logs/%Y-%m-%d.catalina.out /dev/null 21 this will rotate the logs daily Filip - Original Message - From: Carlos [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 15, 2004 2:05 PM Subject: Rotating catalina.out with Webmin Hi Forum, Could someone recommend settings for using the log rotation of Webmin in order to rotate catalina.out (any cautionary measures)? I just created an entry in Webmin to rotate the catalina.out file weekly with all the default settings (keeping the last four copies). Are there any scripts I should run before or after the rotation is carried out? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] !DSPAM:4199117c52001195320907! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Rotating catalina.out with Webmin
I don't know how to use webadmin. I did it in command line (Debian) /etc/logrotate.d /usr/local/jakarta-tomcat-4.1.30/logs/catalina.out { rotate 5 weekly compress delaycompress notifempty missingok create 0640 tu3404nl tu3404nl } -Original Message- From: Carlos Oliva [mailto:[EMAIL PROTECTED] Sent: November 15, 2004 3:37 PM To: 'Tomcat Users List' Subject: RE: Rotating catalina.out with Webmin Hi Phillip, Since Webmin uses logrotate could I just create a simple entry with Webmin? Or do I need to specify other settings? -Original Message- From: Phillip Qin [mailto:[EMAIL PROTECTED] Sent: Monday, November 15, 2004 3:31 PM To: 'Tomcat Users List' Subject: RE: Rotating catalina.out with Webmin I found that logrotate is the easiest. -Original Message- From: Carlos Oliva [mailto:[EMAIL PROTECTED] Sent: November 15, 2004 3:28 PM To: 'Tomcat Users List' Subject: RE: Rotating catalina.out with Webmin Hi Filip, I set-up the Webmin Log Rotation entry to the following: 1) Re-create log file after rotation? Yes, with mode and owned by user and group 2) Store old rotated logs in Directory Same directory as log file Default (Same directory as log file) 3) Extension for rotated filenames Default Should not this maintain the file handle? -Original Message- From: Filip Hanik - Dev [mailto:[EMAIL PROTECTED] Sent: Monday, November 15, 2004 3:19 PM To: Tomcat Users List Subject: Re: Rotating catalina.out with Webmin if you dont get webmin fixed, I recommend cronolog instead. You cant just rotate it, cause then tomcat loses the file handle, and you will lose all further output. with cronolog you simply pipe it through cronolog like this your java start command | /usr/local/sbin/cronolog $CATALINA_BASE$/logs/%Y-%m-%d.catalina.out /dev/null 21 this will rotate the logs daily Filip - Original Message - From: Carlos [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 15, 2004 2:05 PM Subject: Rotating catalina.out with Webmin Hi Forum, Could someone recommend settings for using the log rotation of Webmin in order to rotate catalina.out (any cautionary measures)? I just created an entry in Webmin to rotate the catalina.out file weekly with all the default settings (keeping the last four copies). Are there any scripts I should run before or after the rotation is carried out? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] !DSPAM:4199138a52451467913336!
Re: Rotating catalina.out with Webmin
On Mon, Nov 15, 2004 at 02:36:57PM -0600, Filip Hanik - Dev wrote: nope, the moment you execute the mv the file handle has moved. switch to cronolog to save you some time, cronolog might recreate the file for you to, so no handle is ever lost, try it before you come back to the list :) [...snip...] if you dont get webmin fixed, I recommend cronolog instead. You cant just rotate it, cause then tomcat loses the file handle, and you will lose all further output. This is incorrect. A reference to an open file stays perfectly valid regardless of what is done to the name of the file. You can even remove the file entirely and any previously opened file handle will continue to function (and take up disk space!). Renaming a file changes the way you get access to the underlying file object but does not change the object itself. Since a file handle that a process has refers to the the underlying object, not the name, output will continue to be written to the original file and the new catalina.out will remain empty. eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Rotating catalina.out with Webmin
this was not the case when using a java.io.FileOutputStream(), so I assume you tried and verified this :) Filip - Original Message - From: [EMAIL PROTECTED] To: Filip Hanik - Dev [EMAIL PROTECTED] Cc: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, November 15, 2004 3:16 PM Subject: Re: Rotating catalina.out with Webmin On Mon, Nov 15, 2004 at 02:36:57PM -0600, Filip Hanik - Dev wrote: nope, the moment you execute the mv the file handle has moved. switch to cronolog to save you some time, cronolog might recreate the file for you to, so no handle is ever lost, try it before you come back to the list :) [...snip...] if you dont get webmin fixed, I recommend cronolog instead. You cant just rotate it, cause then tomcat loses the file handle, and you will lose all further output. This is incorrect. A reference to an open file stays perfectly valid regardless of what is done to the name of the file. You can even remove the file entirely and any previously opened file handle will continue to function (and take up disk space!). Renaming a file changes the way you get access to the underlying file object but does not change the object itself. Since a file handle that a process has refers to the the underlying object, not the name, output will continue to be written to the original file and the new catalina.out will remain empty. eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Rotating catalina.out with Webmin
Hi Phillip, Why do you re-create the file? Is it not enough to truncate it? -Original Message- From: Phillip Qin [mailto:[EMAIL PROTECTED] Sent: Monday, November 15, 2004 3:53 PM To: 'Tomcat Users List' Subject: RE: Rotating catalina.out with Webmin I don't know how to use webadmin. I did it in command line (Debian) /etc/logrotate.d /usr/local/jakarta-tomcat-4.1.30/logs/catalina.out { rotate 5 weekly compress delaycompress notifempty missingok create 0640 tu3404nl tu3404nl } -Original Message- From: Carlos Oliva [mailto:[EMAIL PROTECTED] Sent: November 15, 2004 3:37 PM To: 'Tomcat Users List' Subject: RE: Rotating catalina.out with Webmin Hi Phillip, Since Webmin uses logrotate could I just create a simple entry with Webmin? Or do I need to specify other settings? -Original Message- From: Phillip Qin [mailto:[EMAIL PROTECTED] Sent: Monday, November 15, 2004 3:31 PM To: 'Tomcat Users List' Subject: RE: Rotating catalina.out with Webmin I found that logrotate is the easiest. -Original Message- From: Carlos Oliva [mailto:[EMAIL PROTECTED] Sent: November 15, 2004 3:28 PM To: 'Tomcat Users List' Subject: RE: Rotating catalina.out with Webmin Hi Filip, I set-up the Webmin Log Rotation entry to the following: 1) Re-create log file after rotation? Yes, with mode and owned by user and group 2) Store old rotated logs in Directory Same directory as log file Default (Same directory as log file) 3) Extension for rotated filenames Default Should not this maintain the file handle? -Original Message- From: Filip Hanik - Dev [mailto:[EMAIL PROTECTED] Sent: Monday, November 15, 2004 3:19 PM To: Tomcat Users List Subject: Re: Rotating catalina.out with Webmin if you dont get webmin fixed, I recommend cronolog instead. You cant just rotate it, cause then tomcat loses the file handle, and you will lose all further output. with cronolog you simply pipe it through cronolog like this your java start command | /usr/local/sbin/cronolog $CATALINA_BASE$/logs/%Y-%m-%d.catalina.out /dev/null 21 this will rotate the logs daily Filip - Original Message - From: Carlos [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 15, 2004 2:05 PM Subject: Rotating catalina.out with Webmin Hi Forum, Could someone recommend settings for using the log rotation of Webmin in order to rotate catalina.out (any cautionary measures)? I just created an entry in Webmin to rotate the catalina.out file weekly with all the default settings (keeping the last four copies). Are there any scripts I should run before or after the rotation is carried out? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] !DSPAM:4199138a52451467913336! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Rotating catalina.out with Webmin
I don't remember. I think logrotate recreates it anyway. -Original Message- From: Carlos Oliva [mailto:[EMAIL PROTECTED] Sent: November 15, 2004 4:55 PM To: 'Tomcat Users List' Subject: RE: Rotating catalina.out with Webmin Hi Phillip, Why do you re-create the file? Is it not enough to truncate it? -Original Message- From: Phillip Qin [mailto:[EMAIL PROTECTED] Sent: Monday, November 15, 2004 3:53 PM To: 'Tomcat Users List' Subject: RE: Rotating catalina.out with Webmin I don't know how to use webadmin. I did it in command line (Debian) /etc/logrotate.d /usr/local/jakarta-tomcat-4.1.30/logs/catalina.out { rotate 5 weekly compress delaycompress notifempty missingok create 0640 tu3404nl tu3404nl } -Original Message- From: Carlos Oliva [mailto:[EMAIL PROTECTED] Sent: November 15, 2004 3:37 PM To: 'Tomcat Users List' Subject: RE: Rotating catalina.out with Webmin Hi Phillip, Since Webmin uses logrotate could I just create a simple entry with Webmin? Or do I need to specify other settings? -Original Message- From: Phillip Qin [mailto:[EMAIL PROTECTED] Sent: Monday, November 15, 2004 3:31 PM To: 'Tomcat Users List' Subject: RE: Rotating catalina.out with Webmin I found that logrotate is the easiest. -Original Message- From: Carlos Oliva [mailto:[EMAIL PROTECTED] Sent: November 15, 2004 3:28 PM To: 'Tomcat Users List' Subject: RE: Rotating catalina.out with Webmin Hi Filip, I set-up the Webmin Log Rotation entry to the following: 1) Re-create log file after rotation? Yes, with mode and owned by user and group 2) Store old rotated logs in Directory Same directory as log file Default (Same directory as log file) 3) Extension for rotated filenames Default Should not this maintain the file handle? -Original Message- From: Filip Hanik - Dev [mailto:[EMAIL PROTECTED] Sent: Monday, November 15, 2004 3:19 PM To: Tomcat Users List Subject: Re: Rotating catalina.out with Webmin if you dont get webmin fixed, I recommend cronolog instead. You cant just rotate it, cause then tomcat loses the file handle, and you will lose all further output. with cronolog you simply pipe it through cronolog like this your java start command | /usr/local/sbin/cronolog $CATALINA_BASE$/logs/%Y-%m-%d.catalina.out /dev/null 21 this will rotate the logs daily Filip - Original Message - From: Carlos [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 15, 2004 2:05 PM Subject: Rotating catalina.out with Webmin Hi Forum, Could someone recommend settings for using the log rotation of Webmin in order to rotate catalina.out (any cautionary measures)? I just created an entry in Webmin to rotate the catalina.out file weekly with all the default settings (keeping the last four copies). Are there any scripts I should run before or after the rotation is carried out? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] !DSPAM:419925d560433608341601!
Re: Rotating catalina.out with Webmin
On Mon, Nov 15, 2004 at 03:39:01PM -0600, Filip Hanik - Dev wrote: this was not the case when using a java.io.FileOutputStream(), so I assume you tried and verified this :) You are confused. It _is_ the case with FileOutputStream. The only way it could be otherwise is if the output stream re-opens the file, either on every write, or when it notices that the file name no longer refers to the same file. Create aa.java with this code: import java.io.*; public class aa { public static void main(String[] args) throws Exception { FileOutputStream f = new FileOutputStream(args[0]); f.write(80); f.flush(); synchronized(f) { f.wait(5 * 1000); } f.write(81); f.flush(); } } And run this: java aa foo mv foo bar Notice that the output of the second write (which occurs after the file is renamed) is in the original file (bar), not in a new foo. eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]