You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Nuno Carvalho <nu...@hotpop.com> on 2003/01/24 12:43:57 UTC
Creating the rotated log files even if there is no accesses
Hi there,
I developed a service which uses the DailyRollingFileAppender class logger. It works fine but it has a behaviour that I
need to overcome.
Note: The logging system is being made on a daily basis.
I will give you an example to explain my problem:
* On the 22 January 2003 the service generated the logs to the accessGW.log file.
* On the 23 January 2003 there was no accesses to the service.
* Today, 24 January 2003, there was still no accesses to the service and therefore the accessGW.log.2003-01-23 was not
created.
I was thinking on creating a new thread on the service for calling the logger (of course, i don't want to generate a
fake log information, I would need a kind of NOP) in order to the accessGW.log.2003-01-23 be created. Which log4j method
should I use ?
Is there any other idea to overcome this ?
BTW, if there is no accesses then i would like that log4j creates a log file for that day with length zero.
Thanks in advance.
Best regards,
Nuno Carvalho
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Creating the rotated log files even if there is no accesses
Posted by Daniel Serodio <da...@checkforte.com.br>.
We use FileAppender and roll it over with a crontab job, along the lines
of:
cp $logfile $logfile-$(date -I) && cat /dev/null > $logfile
Hope this helps.
[]'s
Daniel Serodio
On Fri, 2003-01-24 at 11:49, Nuno Carvalho wrote:
> Daniel Serodio wrote:
>
> > On Fri, 2003-01-24 at 10:54, Nuno Carvalho wrote:
> >
> > Well, you can always report that there were 0 hits on a day when no log
> > file was generated.
>
> Olá Daniel,
>
> The marketing team already have some kind of a shell script to check for specific log filenames. Therefore, I need to
> provide the expected behaviour they need.
>
> Any idea on how to solve this ? Is there some way to call a rollover function ?
>
> Regards,
> Nuno Carvalho
>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
Daniel Serodio <da...@checkforte.com.br>
CheckForte
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Creating the rotated log files even if there is no accesses
Posted by Nuno Carvalho <nu...@hotpop.com>.
Daniel Serodio wrote:
> On Fri, 2003-01-24 at 10:54, Nuno Carvalho wrote:
>
> Well, you can always report that there were 0 hits on a day when no log
> file was generated.
Olá Daniel,
The marketing team already have some kind of a shell script to check for specific log filenames. Therefore, I need to
provide the expected behaviour they need.
Any idea on how to solve this ? Is there some way to call a rollover function ?
Regards,
Nuno Carvalho
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Creating the rotated log files even if there is no accesses
Posted by Daniel Serodio <da...@checkforte.com.br>.
On Fri, 2003-01-24 at 10:54, Nuno Carvalho wrote:
> Ceki Gülcü wrote:
>
> Hi Ceki,
>
> > Is whole days go by without a single log been generated, then why do you
> > need to rotate log files?
>
> There are days with too much traffic and some others don't.
> I need to rotate them on a daily basis in order to send a daily report to the marketing team.
Well, you can always report that there were 0 hits on a day when no log
file was generated.
> > To answer your question, there is no NOP operation. However, you could
> > modify DailyRollingFileAppender to roll on demand. There is such an
> > appender. It is org.apache.log4j.varia.ExternallyRolledFileAppender
>
> The ExternallyRolledFileAppender class seems to implement a client/server solution. I need to use another approach.
>
> Thanks.
>
> Regards,
> Nuno Carvalho
--
Daniel Serodio <da...@checkforte.com.br>
CheckForte
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Creating the rotated log files even if there is no accesses
Posted by Nuno Carvalho <nu...@hotpop.com>.
Ceki Gülcü wrote:
Hi Ceki,
> Is whole days go by without a single log been generated, then why do you
> need to rotate log files?
There are days with too much traffic and some others don't.
I need to rotate them on a daily basis in order to send a daily report to the marketing team.
> To answer your question, there is no NOP operation. However, you could
> modify DailyRollingFileAppender to roll on demand. There is such an
> appender. It is org.apache.log4j.varia.ExternallyRolledFileAppender
The ExternallyRolledFileAppender class seems to implement a client/server solution. I need to use another approach.
Thanks.
Regards,
Nuno Carvalho
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Creating the rotated log files even if there is no accesses
Posted by Ceki Gülcü <ce...@qos.ch>.
Is whole days go by without a single log been generated, then why do you
need to rotate log files?
To answer your question, there is no NOP operation. However, you could
modify DailyRollingFileAppender to roll on demand. There is such an
appender. It is org.apache.log4j.varia.ExternallyRolledFileAppender
At 11:43 24.01.2003 +0000, you wrote:
>Hi there,
>
>I developed a service which uses the DailyRollingFileAppender class
>logger. It works fine but it has a behaviour that I need to overcome.
>
>Note: The logging system is being made on a daily basis.
>
>I will give you an example to explain my problem:
>
>
>* On the 22 January 2003 the service generated the logs to the
>accessGW.log file.
>
>* On the 23 January 2003 there was no accesses to the service.
>
>* Today, 24 January 2003, there was still no accesses to the service and
>therefore the accessGW.log.2003-01-23 was not created.
>
>
>I was thinking on creating a new thread on the service for calling the
>logger (of course, i don't want to generate a fake log information, I
>would need a kind of NOP) in order to the accessGW.log.2003-01-23 be
>created. Which log4j method should I use ?
>
>Is there any other idea to overcome this ?
>
>BTW, if there is no accesses then i would like that log4j creates a log
>file for that day with length zero.
>
>Thanks in advance.
>
>Best regards,
> Nuno Carvalho
>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
--
Ceki
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>