Re: Log File Problems in tomcat
2011/4/8 Harsimranjit singh Kler : > Whenever i am deleting log files(catalina,localhost etc log files) from > tomcat_home\logs path.These are not auto genrating .Everytime i need to > restart tomcat to get thise files i dont want this.Any solution to this? That is how unixes work. See "man unlink" e.g. here [1] or the POSIX spec. The actual deletion happens only when all applications that are reading or writing the file have closed it. [1] http://linux.die.net/man/2/unlink You can truncate the file though, without deleting it. I think the following will work: cat /dev/null > yourfile Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Log File Problems in tomcat
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Harsimranjit, On 4/8/2011 3:18 PM, Harsimranjit singh Kler wrote: > Whenever i am deleting log files(catalina,localhost etc log files) from > tomcat_home\logs path.These are not auto genrating .Everytime i need to > restart tomcat to get thise files i dont want this.Any solution to this? Yes: stop deleting the log files. > Same problem with my application logs i am using SLF4J and logback to > genrate logs.once application log files removed i need to restart tomcat to > regenrate. You should configure SLF4J to perform log file rolling for you, instead of trying to (evidently) do it yourself. > Problem with Linux only window not alow to delete log files in use. please > update if anything i can configure to overcome this Step 1: stop logging things to stdout/stderr Step 2: configure Tomcat's loggers to roll on whatever schedule you like http://tomcat.apache.org/tomcat-7.0-doc/logging.html Step 3: configure your application loggers to roll on whatever schedule you like - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk2fdk4ACgkQ9CaO5/Lv0PBdfwCcDhsQ5lWRIk9pFi2reixJZT5U KccAoKqhvB35Hsof8aZyfUSU7aDwDNM3 =+dcg -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Log File Problems in tomcat
Thanks for reply. I was also thinking in that way but after all i need same user to delete(for eg old log deletion or manual deletion) also.So want to avoid restarting tomcat just to create new logs. Looking for some solution at tomcat level so my tomcat always run even if current log files are deleted it should able to genrate new log file automatically. On Sat, Apr 9, 2011 at 1:37 AM, Pid wrote: > On 4/8/11 8:18 PM, Harsimranjit singh Kler wrote: > > hi > > > > Using tomcat 5.5.27 on Linux machine . > > > > Whenever i am deleting log files(catalina,localhost etc log files) from > > tomcat_home\logs path.These are not auto genrating .Everytime i need to > > restart tomcat to get thise files i dont want this.Any solution to this? > > > > Same problem with my application logs i am using SLF4J and logback to > > genrate logs.once application log files removed i need to restart tomcat > to > > regenrate. > > > > Problem with Linux only window not alow to delete log files in use.please > > update if anything i can configure to overcome this > > You could get someone to configure Tomcat to run under an account you > don't have permission to access, this would prevent anyone from doing > something so silly as to delete the log files while Tomcat is using them. > > > p > > > -- Regards Harsimranjit Singh Kler
Fwd: Log File Problems in tomcat
hi Using tomcat 5.5.27 on Linux machine . Whenever i am deleting log files(catalina,localhost etc log files) from tomcat_home\logs path.These are not auto genrating .Everytime i need to restart tomcat to get thise files i dont want this.Any solution to this? Same problem with my application logs i am using SLF4J and logback to genrate logs.once application log files removed i need to restart tomcat to regenrate. Problem with Linux only window not alow to delete log files in use.please update if anything i can configure to overcome this -- Regards Harsimran
Re: Log File Problems in tomcat
On 4/8/11 8:18 PM, Harsimranjit singh Kler wrote: > hi > > Using tomcat 5.5.27 on Linux machine . > > Whenever i am deleting log files(catalina,localhost etc log files) from > tomcat_home\logs path.These are not auto genrating .Everytime i need to > restart tomcat to get thise files i dont want this.Any solution to this? > > Same problem with my application logs i am using SLF4J and logback to > genrate logs.once application log files removed i need to restart tomcat to > regenrate. > > Problem with Linux only window not alow to delete log files in use.please > update if anything i can configure to overcome this You could get someone to configure Tomcat to run under an account you don't have permission to access, this would prevent anyone from doing something so silly as to delete the log files while Tomcat is using them. p signature.asc Description: OpenPGP digital signature
Log File Problems in tomcat
hi Using tomcat 5.5.27 on Linux machine . Whenever i am deleting log files(catalina,localhost etc log files) from tomcat_home\logs path.These are not auto genrating .Everytime i need to restart tomcat to get thise files i dont want this.Any solution to this? Same problem with my application logs i am using SLF4J and logback to genrate logs.once application log files removed i need to restart tomcat to regenrate. Problem with Linux only window not alow to delete log files in use.please update if anything i can configure to overcome this -- Regards Harsimran