You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Vijay <vi...@gmail.com> on 2009/05/22 01:06:11 UTC
tomcat Access logs
Hi,
I am using a tomcat tailer which needs the file name to be the same and not
changinging (Dont want to see the Date in the file name). hence i want a
solution to have the logs rotated as well as the file name of the active log
files to remain the same.... Do we have a solution like it?
When i search in the internet i found logrotate copytruncate option
available, can we use this? whats the implication? do you guys recommend it?
Regards,
</VJ>
Re: tomcat Access logs
Posted by Vijay <vi...@gmail.com>.
The problem is that i cannot use copy truncate, coz the access log is
currently 200MB and we expect it to grow... it takes time to copy and in our
production system we dont want to loose the data..... same issue when i use
a perl or other scripts....
We are currently using tomcat 5 so option 2 i more complicated for us.
Thanks for your input's and i will try both the option in all different ways
i can address it.
Regards,
</VJ>
On Mon, May 25, 2009 at 4:03 PM, Martin Gainty <mg...@hotmail.com> wrote:
>
> logrotate is designed to ease administration of systems that
> generate
> large numbers of log files. It allows automatic rotation,
> compression,
> removal, and mailing of log files. Each log file may be handled
> daily,
> weekly, monthly, or when it grows too large.
> http://iain.cx/src/logrotate/
>
> and logrotate parameter copytruncate
> copytruncate
> Truncate the original log file to zero size in place after
> creating a copy,
> instead of moving the old log file and optionally creating a
> new one. It can be
> used when some program cannot be told to close its logfile and
> thus might con-
> tinue writing (appending) to the previous log file forever.
> Note that there is a
> very small time slice between copying the file and truncating
> it, so some logging
> data might be lost. When this option is used, the create
> option will have no
> effect, as the old log file stays in place.
> http://www.mythtv.org/wiki/Log_File_Rotationlog4j and commons-logging are
> loggind implementations specific to TC logging
> http://tomcat.apache.org/tomcat-6.0-doc/logging.html
>
> apparently logrotate (with copyrotate option) has the widest range of
> logging activity for application, cron and webapps available
>
> ?
> Martin Gainty
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>
>
>
> > From: vijay2win@gmail.com
> > Date: Mon, 25 May 2009 10:36:15 -0700
> > Subject: Re: tomcat Access logs
> > To: users@tomcat.apache.org
> >
> > Hi,
> > Any help will be useful... should i write a custom log4j class instead of
> > accessvalve class in tomcat?
> >
> > Regards,
> > </VJ>
> >
> >
> >
> >
> > On Thu, May 21, 2009 at 4:06 PM, Vijay <vi...@gmail.com> wrote:
> >
> > > Hi,
> > > I am using a tomcat tailer which needs the file name to be the same and
> not
> > > changinging (Dont want to see the Date in the file name). hence i want
> a
> > > solution to have the logs rotated as well as the file name of the
> active log
> > > files to remain the same.... Do we have a solution like it?
> > >
> > > When i search in the internet i found logrotate copytruncate option
> > > available, can we use this? whats the implication? do you guys
> recommend it?
> > >
> > > Regards,
> > > </VJ>
> > >
>
> _________________________________________________________________
> Hotmail® has a new way to see what's up with your friends.
>
> http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009
>
RE: tomcat Access logs
Posted by Martin Gainty <mg...@hotmail.com>.
logrotate is designed to ease administration of systems that generate
large numbers of log files. It allows automatic rotation, compression,
removal, and mailing of log files. Each log file may be handled daily,
weekly, monthly, or when it grows too large.
http://iain.cx/src/logrotate/
and logrotate parameter copytruncate
copytruncate
Truncate the original log file to zero size in place after creating a copy,
instead of moving the old log file and optionally creating a new one. It can be
used when some program cannot be told to close its logfile and thus might con-
tinue writing (appending) to the previous log file forever. Note that there is a
very small time slice between copying the file and truncating it, so some logging
data might be lost. When this option is used, the create option will have no
effect, as the old log file stays in place.
http://www.mythtv.org/wiki/Log_File_Rotationlog4j and commons-logging are loggind implementations specific to TC logging
http://tomcat.apache.org/tomcat-6.0-doc/logging.html
apparently logrotate (with copyrotate option) has the widest range of logging activity for application, cron and webapps available
?
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> From: vijay2win@gmail.com
> Date: Mon, 25 May 2009 10:36:15 -0700
> Subject: Re: tomcat Access logs
> To: users@tomcat.apache.org
>
> Hi,
> Any help will be useful... should i write a custom log4j class instead of
> accessvalve class in tomcat?
>
> Regards,
> </VJ>
>
>
>
>
> On Thu, May 21, 2009 at 4:06 PM, Vijay <vi...@gmail.com> wrote:
>
> > Hi,
> > I am using a tomcat tailer which needs the file name to be the same and not
> > changinging (Dont want to see the Date in the file name). hence i want a
> > solution to have the logs rotated as well as the file name of the active log
> > files to remain the same.... Do we have a solution like it?
> >
> > When i search in the internet i found logrotate copytruncate option
> > available, can we use this? whats the implication? do you guys recommend it?
> >
> > Regards,
> > </VJ>
> >
_________________________________________________________________
Hotmail® has a new way to see what's up with your friends.
http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009
Re: tomcat Access logs
Posted by André Warnier <aw...@ice-sa.com>.
Vijay wrote:
> Hi,
> Any help will be useful... should i write a custom log4j class instead of
> accessvalve class in tomcat?
>
...
Yeah, well, welcome to the beautiful and mysterious world of Tomcat
logging. It is unfortunately totally incomprehensible to mere mortals,
and you will need the assistance of one of the licensed gurus to
navigate through its convoluted and labyrintine subtleties.
My advice would be to leave everything as it is, and write an external
script using a real programming language (like Perl), to collect the
logfiles older than 24 hours and do with them what you want.
In all likelihood however, the apostatic paragraph above should trigger
some reactions here, so I would wait another couple of hours for other
suggestions.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: tomcat Access logs
Posted by Vijay <vi...@gmail.com>.
Hi,
Any help will be useful... should i write a custom log4j class instead of
accessvalve class in tomcat?
Regards,
</VJ>
On Thu, May 21, 2009 at 4:06 PM, Vijay <vi...@gmail.com> wrote:
> Hi,
> I am using a tomcat tailer which needs the file name to be the same and not
> changinging (Dont want to see the Date in the file name). hence i want a
> solution to have the logs rotated as well as the file name of the active log
> files to remain the same.... Do we have a solution like it?
>
> When i search in the internet i found logrotate copytruncate option
> available, can we use this? whats the implication? do you guys recommend it?
>
> Regards,
> </VJ>
>
Re: tomcat Access logs
Posted by Konstantin Kolinko <kn...@gmail.com>.
2009/5/22 Vijay <vi...@gmail.com>:
> Hi,
> I am using a tomcat tailer which needs the file name to be the same and not
> changinging (Dont want to see the Date in the file name). hence i want a
> solution to have the logs rotated as well as the file name of the active log
> files to remain the same.... Do we have a solution like it?
>
Try to specify rotatable="false" in your configuration of AccessLogValve.
> When i search in the internet i found logrotate copytruncate option
> available, can we use this? whats the implication? do you guys recommend it?
>
It is fine. I am using it.
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org