You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Harsimranjit singh Kler <si...@gmail.com> on 2011/04/08 21:18:07 UTC

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

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/4/8 Harsimranjit singh Kler <si...@gmail.com>:
> 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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Fwd: Log File Problems in tomcat

Posted by Harsimranjit singh Kler <si...@gmail.com>.
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

Posted by Harsimranjit singh Kler <si...@gmail.com>.
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 <pi...@pidster.com> 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

Re: Log File Problems in tomcat

Posted by Pid <pi...@pidster.com>.
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



Re: Log File Problems in tomcat

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org