problems with TimeBasedRollingPolicy

Hello, I have following logback rolling file appender configuration: <appender name="DWHTextToolActionLogger" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${user.home}/data/inbound/csi/text_approval/xxx_text_approval.csv</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <fileNamePattern>${user.home}/data/inbound/csi/text_approval/xxx_text_approval_%d{yyyy_MM_dd}.csv.gz</fileNamePattern> <maxHistory>100</maxHistory> </rollingPolicy> <encoder> <pattern>%m%n</pattern> </encoder> </appender> <logger name="DWHTextToolActionLogger" additivity="false"> <level value="INFO" /> <appender-ref ref="DWHTextToolActionLogger" /> </logger> I would expect the log file to roll nightly, however, I only see following files: -rw-r--r-- 1 xxx xxx 236K Jun 28 14:08 xxx_text_approval.csv -rw-r--r-- 1 xxx xxx 39K Jun 22 08:21 xxx_text_approval_2011_06_21.csv.gz -rw-r--r-- 1 xxx xxx 32K Jun 23 08:18 xxx_text_approval_2011_06_22.csv.gz -rw-r--r-- 1 xxx xxx 35K Jun 24 07:52 xxx_text_approval_2011_06_23.csv.gz -rw-r--r-- 1 xxx xxx 26K Jun 25 07:43 xxx_text_approval_2011_06_24.csv.gz -rw-r--r-- 1 xxx xxx 41K Jun 26 07:50 xxx_text_approval_2011_06_25.csv.gz -rw-r--r-- 1 xxx xxx 28K Jun 27 07:44 xxx_text_approval_2011_06_26.csv.gz -rw-r--r-- 1 xxx xxx 57K Jun 28 08:12 xxx_text_approval_2011_06_27.csv.gz Is it misconfigured, or does the rolling actually happens at the first log message in the morning? If it's action based, how can i configure rolling to be triggered @midnight no matter how empty or full the log is? regards Leon p.s. version: <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>0.9.28</version>

Yes it rolls on the first message. To force rolling, log a message. On 28 Jun 2011, at 13:13, Leon Rosenberg <rosenberg.leon@gmail.com> wrote:
Hello,
I have following logback rolling file appender configuration:
<appender name="DWHTextToolActionLogger" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${user.home}/data/inbound/csi/text_approval/xxx_text_approval.csv</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <fileNamePattern>${user.home}/data/inbound/csi/text_approval/xxx_text_approval_%d{yyyy_MM_dd}.csv.gz</fileNamePattern> <maxHistory>100</maxHistory> </rollingPolicy> <encoder> <pattern>%m%n</pattern> </encoder> </appender>
<logger name="DWHTextToolActionLogger" additivity="false"> <level value="INFO" /> <appender-ref ref="DWHTextToolActionLogger" /> </logger>
I would expect the log file to roll nightly, however, I only see following files:
-rw-r--r-- 1 xxx xxx 236K Jun 28 14:08 xxx_text_approval.csv -rw-r--r-- 1 xxx xxx 39K Jun 22 08:21 xxx_text_approval_2011_06_21.csv.gz -rw-r--r-- 1 xxx xxx 32K Jun 23 08:18 xxx_text_approval_2011_06_22.csv.gz -rw-r--r-- 1 xxx xxx 35K Jun 24 07:52 xxx_text_approval_2011_06_23.csv.gz -rw-r--r-- 1 xxx xxx 26K Jun 25 07:43 xxx_text_approval_2011_06_24.csv.gz -rw-r--r-- 1 xxx xxx 41K Jun 26 07:50 xxx_text_approval_2011_06_25.csv.gz -rw-r--r-- 1 xxx xxx 28K Jun 27 07:44 xxx_text_approval_2011_06_26.csv.gz -rw-r--r-- 1 xxx xxx 57K Jun 28 08:12 xxx_text_approval_2011_06_27.csv.gz
Is it misconfigured, or does the rolling actually happens at the first log message in the morning? If it's action based, how can i configure rolling to be triggered @midnight no matter how empty or full the log is?
regards Leon
p.s. version: <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>0.9.28</version> _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user

Thanx for the reply, David. Is there another, less hackier way to do it? The problem with 'log-a-message' approach, is that this log file only contains events that really happened and is parsed and imported into another reporting tool. So if we start to log a message at 00:01, we have to force the people who write the reporting tool to ignore this special message type etc. I would prefer to keep things simpler, is there a possibility to force logging behavior without actually logging something? Like a log.nop()? ;-) Another possibility we were thinking about was to have a cron job performing touch on the logback.xml, which should also trigger rolling. Or wouldn't it not? Any other ideas? thanx in advance Leon On Tue, Jun 28, 2011 at 3:33 PM, David Roussel <nabble@diroussel.xsmail.com> wrote:
Yes it rolls on the first message. To force rolling, log a message.
On 28 Jun 2011, at 13:13, Leon Rosenberg <rosenberg.leon@gmail.com> wrote:
Hello,
I have following logback rolling file appender configuration:
<appender name="DWHTextToolActionLogger" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${user.home}/data/inbound/csi/text_approval/xxx_text_approval.csv</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <fileNamePattern>${user.home}/data/inbound/csi/text_approval/xxx_text_approval_%d{yyyy_MM_dd}.csv.gz</fileNamePattern> <maxHistory>100</maxHistory> </rollingPolicy> <encoder> <pattern>%m%n</pattern> </encoder> </appender>
<logger name="DWHTextToolActionLogger" additivity="false"> <level value="INFO" /> <appender-ref ref="DWHTextToolActionLogger" /> </logger>
I would expect the log file to roll nightly, however, I only see following files:
-rw-r--r-- 1 xxx xxx 236K Jun 28 14:08 xxx_text_approval.csv -rw-r--r-- 1 xxx xxx 39K Jun 22 08:21 xxx_text_approval_2011_06_21.csv.gz -rw-r--r-- 1 xxx xxx 32K Jun 23 08:18 xxx_text_approval_2011_06_22.csv.gz -rw-r--r-- 1 xxx xxx 35K Jun 24 07:52 xxx_text_approval_2011_06_23.csv.gz -rw-r--r-- 1 xxx xxx 26K Jun 25 07:43 xxx_text_approval_2011_06_24.csv.gz -rw-r--r-- 1 xxx xxx 41K Jun 26 07:50 xxx_text_approval_2011_06_25.csv.gz -rw-r--r-- 1 xxx xxx 28K Jun 27 07:44 xxx_text_approval_2011_06_26.csv.gz -rw-r--r-- 1 xxx xxx 57K Jun 28 08:12 xxx_text_approval_2011_06_27.csv.gz
Is it misconfigured, or does the rolling actually happens at the first log message in the morning? If it's action based, how can i configure rolling to be triggered @midnight no matter how empty or full the log is?
regards Leon
p.s. version: <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>0.9.28</version> _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user

What difference does the creation time of the log file make? Why is it important to you? David On 29 Jun 2011, at 17:17, Leon Rosenberg <rosenberg.leon@gmail.com> wrote:
Thanx for the reply, David. Is there another, less hackier way to do it? The problem with 'log-a-message' approach, is that this log file only contains events that really happened and is parsed and imported into another reporting tool. So if we start to log a message at 00:01, we have to force the people who write the reporting tool to ignore this special message type etc. I would prefer to keep things simpler, is there a possibility to force logging behavior without actually logging something? Like a log.nop()? ;-)
Another possibility we were thinking about was to have a cron job performing touch on the logback.xml, which should also trigger rolling. Or wouldn't it not?
Any other ideas?
thanx in advance Leon
On Tue, Jun 28, 2011 at 3:33 PM, David Roussel <nabble@diroussel.xsmail.com> wrote:
Yes it rolls on the first message. To force rolling, log a message.
On 28 Jun 2011, at 13:13, Leon Rosenberg <rosenberg.leon@gmail.com> wrote:
Hello,
I have following logback rolling file appender configuration:
<appender name="DWHTextToolActionLogger" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${user.home}/data/inbound/csi/text_approval/xxx_text_approval.csv</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <fileNamePattern>${user.home}/data/inbound/csi/text_approval/xxx_text_approval_%d{yyyy_MM_dd}.csv.gz</fileNamePattern> <maxHistory>100</maxHistory> </rollingPolicy> <encoder> <pattern>%m%n</pattern> </encoder> </appender>
<logger name="DWHTextToolActionLogger" additivity="false"> <level value="INFO" /> <appender-ref ref="DWHTextToolActionLogger" /> </logger>
I would expect the log file to roll nightly, however, I only see following files:
-rw-r--r-- 1 xxx xxx 236K Jun 28 14:08 xxx_text_approval.csv -rw-r--r-- 1 xxx xxx 39K Jun 22 08:21 xxx_text_approval_2011_06_21.csv.gz -rw-r--r-- 1 xxx xxx 32K Jun 23 08:18 xxx_text_approval_2011_06_22.csv.gz -rw-r--r-- 1 xxx xxx 35K Jun 24 07:52 xxx_text_approval_2011_06_23.csv.gz -rw-r--r-- 1 xxx xxx 26K Jun 25 07:43 xxx_text_approval_2011_06_24.csv.gz -rw-r--r-- 1 xxx xxx 41K Jun 26 07:50 xxx_text_approval_2011_06_25.csv.gz -rw-r--r-- 1 xxx xxx 28K Jun 27 07:44 xxx_text_approval_2011_06_26.csv.gz -rw-r--r-- 1 xxx xxx 57K Jun 28 08:12 xxx_text_approval_2011_06_27.csv.gz
Is it misconfigured, or does the rolling actually happens at the first log message in the morning? If it's action based, how can i configure rolling to be triggered @midnight no matter how empty or full the log is?
regards Leon
p.s. version: <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>0.9.28</version> _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user

On Thu, Jun 30, 2011 at 11:44 AM, David Roussel <nabble@diroussel.xsmail.com> wrote:
What difference does the creation time of the log file make? Why is it important to you?
Hello David, we have a cron job that copies the work-results from last day aka log file into a special data warehouse, where its analyzed by a bunch of analysts ;-) regards Leon
David
On 29 Jun 2011, at 17:17, Leon Rosenberg <rosenberg.leon@gmail.com> wrote:
Thanx for the reply, David. Is there another, less hackier way to do it? The problem with 'log-a-message' approach, is that this log file only contains events that really happened and is parsed and imported into another reporting tool. So if we start to log a message at 00:01, we have to force the people who write the reporting tool to ignore this special message type etc. I would prefer to keep things simpler, is there a possibility to force logging behavior without actually logging something? Like a log.nop()? ;-)
Another possibility we were thinking about was to have a cron job performing touch on the logback.xml, which should also trigger rolling. Or wouldn't it not?
Any other ideas?
thanx in advance Leon
On Tue, Jun 28, 2011 at 3:33 PM, David Roussel <nabble@diroussel.xsmail.com> wrote:
Yes it rolls on the first message. To force rolling, log a message.
On 28 Jun 2011, at 13:13, Leon Rosenberg <rosenberg.leon@gmail.com> wrote:
Hello,
I have following logback rolling file appender configuration:
<appender name="DWHTextToolActionLogger" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${user.home}/data/inbound/csi/text_approval/xxx_text_approval.csv</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <fileNamePattern>${user.home}/data/inbound/csi/text_approval/xxx_text_approval_%d{yyyy_MM_dd}.csv.gz</fileNamePattern> <maxHistory>100</maxHistory> </rollingPolicy> <encoder> <pattern>%m%n</pattern> </encoder> </appender>
<logger name="DWHTextToolActionLogger" additivity="false"> <level value="INFO" /> <appender-ref ref="DWHTextToolActionLogger" /> </logger>
I would expect the log file to roll nightly, however, I only see following files:
-rw-r--r-- 1 xxx xxx 236K Jun 28 14:08 xxx_text_approval.csv -rw-r--r-- 1 xxx xxx 39K Jun 22 08:21 xxx_text_approval_2011_06_21.csv.gz -rw-r--r-- 1 xxx xxx 32K Jun 23 08:18 xxx_text_approval_2011_06_22.csv.gz -rw-r--r-- 1 xxx xxx 35K Jun 24 07:52 xxx_text_approval_2011_06_23.csv.gz -rw-r--r-- 1 xxx xxx 26K Jun 25 07:43 xxx_text_approval_2011_06_24.csv.gz -rw-r--r-- 1 xxx xxx 41K Jun 26 07:50 xxx_text_approval_2011_06_25.csv.gz -rw-r--r-- 1 xxx xxx 28K Jun 27 07:44 xxx_text_approval_2011_06_26.csv.gz -rw-r--r-- 1 xxx xxx 57K Jun 28 08:12 xxx_text_approval_2011_06_27.csv.gz
Is it misconfigured, or does the rolling actually happens at the first log message in the morning? If it's action based, how can i configure rolling to be triggered @midnight no matter how empty or full the log is?
regards Leon
p.s. version: <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>0.9.28</version> _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user

Well the log a special line at 00:01, to force the roll, then filter it out when you copy the log file for analysis. Alternatively have a look in the logback source code and work out where you can add a thread to force the rollover event. David On 30 Jun 2011, at 10:57, Leon Rosenberg <rosenberg.leon@gmail.com> wrote:
On Thu, Jun 30, 2011 at 11:44 AM, David Roussel <nabble@diroussel.xsmail.com> wrote:
What difference does the creation time of the log file make? Why is it important to you?
Hello David,
we have a cron job that copies the work-results from last day aka log file into a special data warehouse, where its analyzed by a bunch of analysts ;-) regards Leon
David
On 29 Jun 2011, at 17:17, Leon Rosenberg <rosenberg.leon@gmail.com> wrote:
Thanx for the reply, David. Is there another, less hackier way to do it? The problem with 'log-a-message' approach, is that this log file only contains events that really happened and is parsed and imported into another reporting tool. So if we start to log a message at 00:01, we have to force the people who write the reporting tool to ignore this special message type etc. I would prefer to keep things simpler, is there a possibility to force logging behavior without actually logging something? Like a log.nop()? ;-)
Another possibility we were thinking about was to have a cron job performing touch on the logback.xml, which should also trigger rolling. Or wouldn't it not?
Any other ideas?
thanx in advance Leon
On Tue, Jun 28, 2011 at 3:33 PM, David Roussel <nabble@diroussel.xsmail.com> wrote:
Yes it rolls on the first message. To force rolling, log a message.
On 28 Jun 2011, at 13:13, Leon Rosenberg <rosenberg.leon@gmail.com> wrote:
Hello,
I have following logback rolling file appender configuration:
<appender name="DWHTextToolActionLogger" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${user.home}/data/inbound/csi/text_approval/xxx_text_approval.csv</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <fileNamePattern>${user.home}/data/inbound/csi/text_approval/xxx_text_approval_%d{yyyy_MM_dd}.csv.gz</fileNamePattern> <maxHistory>100</maxHistory> </rollingPolicy> <encoder> <pattern>%m%n</pattern> </encoder> </appender>
<logger name="DWHTextToolActionLogger" additivity="false"> <level value="INFO" /> <appender-ref ref="DWHTextToolActionLogger" /> </logger>
I would expect the log file to roll nightly, however, I only see following files:
-rw-r--r-- 1 xxx xxx 236K Jun 28 14:08 xxx_text_approval.csv -rw-r--r-- 1 xxx xxx 39K Jun 22 08:21 xxx_text_approval_2011_06_21.csv.gz -rw-r--r-- 1 xxx xxx 32K Jun 23 08:18 xxx_text_approval_2011_06_22.csv.gz -rw-r--r-- 1 xxx xxx 35K Jun 24 07:52 xxx_text_approval_2011_06_23.csv.gz -rw-r--r-- 1 xxx xxx 26K Jun 25 07:43 xxx_text_approval_2011_06_24.csv.gz -rw-r--r-- 1 xxx xxx 41K Jun 26 07:50 xxx_text_approval_2011_06_25.csv.gz -rw-r--r-- 1 xxx xxx 28K Jun 27 07:44 xxx_text_approval_2011_06_26.csv.gz -rw-r--r-- 1 xxx xxx 57K Jun 28 08:12 xxx_text_approval_2011_06_27.csv.gz
Is it misconfigured, or does the rolling actually happens at the first log message in the morning? If it's action based, how can i configure rolling to be triggered @midnight no matter how empty or full the log is?
regards Leon
p.s. version: <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>0.9.28</version> _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user

I may have missed something but is there a specific reason you can't use the date in the filename itself? My only concern would be what happens if you don't log for a day, the first log will trigger a roll but the rolled file may be dated incorrectly? Anyway if that is the case you can use prudent (or something equivalent) which doesn't actually rename the files but writes to the actual target file with date and all. On 1 July 2011 08:37, David Roussel <nabble@diroussel.xsmail.com> wrote:
Well the log a special line at 00:01, to force the roll, then filter it out when you copy the log file for analysis.
Alternatively have a look in the logback source code and work out where you can add a thread to force the rollover event.
David
On 30 Jun 2011, at 10:57, Leon Rosenberg <rosenberg.leon@gmail.com> wrote:
On Thu, Jun 30, 2011 at 11:44 AM, David Roussel <nabble@diroussel.xsmail.com> wrote:
What difference does the creation time of the log file make? Why is it important to you?
Hello David,
we have a cron job that copies the work-results from last day aka log file into a special data warehouse, where its analyzed by a bunch of analysts ;-) regards Leon
David
On 29 Jun 2011, at 17:17, Leon Rosenberg <rosenberg.leon@gmail.com> wrote:
Thanx for the reply, David. Is there another, less hackier way to do it? The problem with 'log-a-message' approach, is that this log file only contains events that really happened and is parsed and imported into another reporting tool. So if we start to log a message at 00:01, we have to force the people who write the reporting tool to ignore this special message type etc. I would prefer to keep things simpler, is there a possibility to force logging behavior without actually logging something? Like a log.nop()? ;-)
Another possibility we were thinking about was to have a cron job performing touch on the logback.xml, which should also trigger rolling. Or wouldn't it not?
Any other ideas?
thanx in advance Leon
On Tue, Jun 28, 2011 at 3:33 PM, David Roussel <nabble@diroussel.xsmail.com> wrote:
Yes it rolls on the first message. To force rolling, log a message.
On 28 Jun 2011, at 13:13, Leon Rosenberg <rosenberg.leon@gmail.com> wrote:
Hello,
I have following logback rolling file appender configuration:
<appender name="DWHTextToolActionLogger" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${user.home}/data/inbound/csi/text_approval/xxx_text_approval.csv</file>
<rollingPolicy
class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${user.home}/data/inbound/csi/text_approval/xxx_text_approval_%d{yyyy_MM_dd}.csv.gz</fileNamePattern>
<maxHistory>100</maxHistory> </rollingPolicy> <encoder> <pattern>%m%n</pattern> </encoder> </appender>
<logger name="DWHTextToolActionLogger" additivity="false"> <level value="INFO" /> <appender-ref ref="DWHTextToolActionLogger" /> </logger>
I would expect the log file to roll nightly, however, I only see following files:
-rw-r--r-- 1 xxx xxx 236K Jun 28 14:08 xxx_text_approval.csv -rw-r--r-- 1 xxx xxx 39K Jun 22 08:21
xxx_text_approval_2011_06_21.csv.gz
-rw-r--r-- 1 xxx xxx 32K Jun 23 08:18 xxx_text_approval_2011_06_22.csv.gz -rw-r--r-- 1 xxx xxx 35K Jun 24 07:52 xxx_text_approval_2011_06_23.csv.gz -rw-r--r-- 1 xxx xxx 26K Jun 25 07:43 xxx_text_approval_2011_06_24.csv.gz -rw-r--r-- 1 xxx xxx 41K Jun 26 07:50 xxx_text_approval_2011_06_25.csv.gz -rw-r--r-- 1 xxx xxx 28K Jun 27 07:44 xxx_text_approval_2011_06_26.csv.gz -rw-r--r-- 1 xxx xxx 57K Jun 28 08:12 xxx_text_approval_2011_06_27.csv.gz
Is it misconfigured, or does the rolling actually happens at the first log message in the morning? If it's action based, how can i configure rolling to be triggered @midnight no matter how empty or full the log is?
regards Leon
p.s. version: <groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>0.9.28</version> _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user

On 01/07/2011 9:08 AM, Alex Vb wrote:
I may have missed something but is there a specific reason you can't use the date in the filename itself?
My only concern would be what happens if you don't log for a day, the first log will trigger a roll but the rolled file may be dated incorrectly? Anyway if that is the case you can use prudent (or something equivalent) which doesn't actually rename the files but writes to the actual target file with date and all.
The file will be dated correctly even it it is rolled over in the next day. -- Ceki

Good to know :) Just out of curiosity, how is this accomplished? Do you look at the created/updated timestamp? Do you look in the log file for dates? Or another method? On 1 July 2011 09:36, Ceki Gülcü <ceki@qos.ch> wrote:
On 01/07/2011 9:08 AM, Alex Vb wrote:
I may have missed something but is there a specific reason you can't use the date in the filename itself?
My only concern would be what happens if you don't log for a day, the first log will trigger a roll but the rolled file may be dated incorrectly? Anyway if that is the case you can use prudent (or something equivalent) which doesn't actually rename the files but writes to the actual target file with date and all.
The file will be dated correctly even it it is rolled over in the next day.
-- Ceki
______________________________**_________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/**listinfo/logback-user<http://qos.ch/mailman/listinfo/logback-user>

Hi Alex, The default implementation of TimeBasedFileNamingAndTriggeringPolicy i.e. DefaultTimeBasedFileNamingAndTriggeringPolicy remembers the date of the latest logging activity prior to the current logging activity triggering roll over. This is the date which will be used for naming the target file for the rollover. When rollover occurs immediately due to application restart, it is the date of the existing log file which is saved into memory. HTH, On 01/07/2011 10:38 AM, Alex Vb wrote:
Good to know :) Just out of curiosity, how is this accomplished? Do you look at the created/updated timestamp? Do you look in the log file for dates? Or another method?
On 1 July 2011 09:36, Ceki Gülcü <ceki@qos.ch <mailto:ceki@qos.ch>> wrote:
On 01/07/2011 9:08 AM, Alex Vb wrote:
I may have missed something but is there a specific reason you can't use the date in the filename itself?
My only concern would be what happens if you don't log for a day, the first log will trigger a roll but the rolled file may be dated incorrectly? Anyway if that is the case you can use prudent (or something equivalent) which doesn't actually rename the files but writes to the actual target file with date and all.
The file will be dated correctly even it it is rolled over in the next day.
-- QOS.ch, main sponsor of cal10n, logback and slf4j open source projects, is looking to hire talented software developers. For further details, see http://logback.qos.ch/job.html
participants (4)
-
Alex Vb
-
Ceki Gülcü
-
David Roussel
-
Leon Rosenberg