[JIRA] Created: (LBCORE-61) TimeBasedRollingPolicy can not be used with any other triggering policies

TimeBasedRollingPolicy can not be used with any other triggering policies ------------------------------------------------------------------------- Key: LBCORE-61 URL: http://jira.qos.ch/browse/LBCORE-61 Project: logback-core Issue Type: Bug Reporter: Szel Zoltan Assignee: Logback dev list Priority: Critical If someone would like to have a time based rolling policy with a size based triggering policy, than the user will get a NullPointerException,: at ch.qos.logback.core.rolling.helper.Compress.GZCompress(Compress.java:130) at ch.qos.logback.core.rolling.TimeBasedRollingPolicy.rollover(TimeBasedRollingPolicy.java:142) at ch.qos.logback.core.rolling.RollingFileAppender.rollover(RollingFileAppender.java:91) at ch.qos.logback.core.rolling.RollingFileAppender.subAppend(RollingFileAppender.java:116) at ch.qos.logback.core.WriterAppender.append(WriterAppender.java:124) at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:81) at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:51) at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:282) at ch.qos.logback.classic.Logger.callAppenders(Logger.java:266) at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:487) at ch.qos.logback.classic.Logger.filterAndLog(Logger.java:479) The cause of this issue is the isTriggeringEvent method in the TimeBasedRollingPolicy which has a side effect, namely it prepares the file name of the file which is about to rotate. If someone uses a triggering policy other than the same TimeBasedRollingPolicy, than the isTriggeringEvent method will not be called, hence the elapsedPeriodFileName will be null, hence a null pointer exception will be thrown in the start of the compression or while renaming. Please modify the isTriggeringEvent to not have this side effect + the rollover logic to capture the time information from the current event. Thanks, Zoltan -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCORE-61?page=com.atlassian.jira.plugin.system.is... ] Ceki Gulcu commented on LBCORE-61: ---------------------------------- Thank you for the precise analysis of the modularity problem in TimeBasedRollingPolicy due to the fact that it is both a TriggeringPolicy and a RollingPolicy. While I agree that there is a modularity issue, in particular respect to the elapsedPeriodFileName field, I don't see why anyone would reasonably want to combine a date based rolling policy with a size based triggering policy. You would get similar sized files each named by date. What is the use for that? While I would like to favorably respond to your request, the use-case (i.e. time based rolling policy with a size based triggering policy) just does not make sense to me.
TimeBasedRollingPolicy can not be used with any other triggering policies -------------------------------------------------------------------------
Key: LBCORE-61 URL: http://jira.qos.ch/browse/LBCORE-61 Project: logback-core Issue Type: Bug Reporter: Szel Zoltan Assignee: Ceki Gulcu Priority: Critical
If someone would like to have a time based rolling policy with a size based triggering policy, than the user will get a NullPointerException,: at ch.qos.logback.core.rolling.helper.Compress.GZCompress(Compress.java:130) at ch.qos.logback.core.rolling.TimeBasedRollingPolicy.rollover(TimeBasedRollingPolicy.java:142) at ch.qos.logback.core.rolling.RollingFileAppender.rollover(RollingFileAppender.java:91) at ch.qos.logback.core.rolling.RollingFileAppender.subAppend(RollingFileAppender.java:116) at ch.qos.logback.core.WriterAppender.append(WriterAppender.java:124) at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:81) at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:51) at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:282) at ch.qos.logback.classic.Logger.callAppenders(Logger.java:266) at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:487) at ch.qos.logback.classic.Logger.filterAndLog(Logger.java:479) The cause of this issue is the isTriggeringEvent method in the TimeBasedRollingPolicy which has a side effect, namely it prepares the file name of the file which is about to rotate. If someone uses a triggering policy other than the same TimeBasedRollingPolicy, than the isTriggeringEvent method will not be called, hence the elapsedPeriodFileName will be null, hence a null pointer exception will be thrown in the start of the compression or while renaming. Please modify the isTriggeringEvent to not have this side effect + the rollover logic to capture the time information from the current event. Thanks, Zoltan
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCORE-61?page=com.atlassian.jira.plugin.system.is... ] Ceki Gulcu edited comment on LBCORE-61 at 7/22/09 11:46 PM: ------------------------------------------------------------ Thank you for the precise analysis of the modularity problem in TimeBasedRollingPolicy due to the fact that it is both a TriggeringPolicy and a RollingPolicy. While I agree that there is a modularity issue, in particular respect to the elapsedPeriodFileName field, I don't see why anyone would reasonably want to combine a date based rolling policy with a size based triggering policy. You would get similar sized files each named by date. What is the use for that? While I would like to favorably respond to your request, the use-case (i.e. time based rolling policy with a size based triggering policy) just does not make sense to me. However, there are other users who have also asked for size based triggering and date based rolling: - http://coding.derkeiler.com/Archive/Java/comp.lang.java.programmer/2006-02/m... was (Author: noreply.ceki@qos.ch): Thank you for the precise analysis of the modularity problem in TimeBasedRollingPolicy due to the fact that it is both a TriggeringPolicy and a RollingPolicy. While I agree that there is a modularity issue, in particular respect to the elapsedPeriodFileName field, I don't see why anyone would reasonably want to combine a date based rolling policy with a size based triggering policy. You would get similar sized files each named by date. What is the use for that? While I would like to favorably respond to your request, the use-case (i.e. time based rolling policy with a size based triggering policy) just does not make sense to me.
TimeBasedRollingPolicy can not be used with any other triggering policies -------------------------------------------------------------------------
Key: LBCORE-61 URL: http://jira.qos.ch/browse/LBCORE-61 Project: logback-core Issue Type: Bug Reporter: Szel Zoltan Assignee: Ceki Gulcu Priority: Critical
If someone would like to have a time based rolling policy with a size based triggering policy, than the user will get a NullPointerException,: at ch.qos.logback.core.rolling.helper.Compress.GZCompress(Compress.java:130) at ch.qos.logback.core.rolling.TimeBasedRollingPolicy.rollover(TimeBasedRollingPolicy.java:142) at ch.qos.logback.core.rolling.RollingFileAppender.rollover(RollingFileAppender.java:91) at ch.qos.logback.core.rolling.RollingFileAppender.subAppend(RollingFileAppender.java:116) at ch.qos.logback.core.WriterAppender.append(WriterAppender.java:124) at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:81) at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:51) at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:282) at ch.qos.logback.classic.Logger.callAppenders(Logger.java:266) at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:487) at ch.qos.logback.classic.Logger.filterAndLog(Logger.java:479) The cause of this issue is the isTriggeringEvent method in the TimeBasedRollingPolicy which has a side effect, namely it prepares the file name of the file which is about to rotate. If someone uses a triggering policy other than the same TimeBasedRollingPolicy, than the isTriggeringEvent method will not be called, hence the elapsedPeriodFileName will be null, hence a null pointer exception will be thrown in the start of the compression or while renaming. Please modify the isTriggeringEvent to not have this side effect + the rollover logic to capture the time information from the current event. Thanks, Zoltan
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCORE-61?page=com.atlassian.jira.plugin.system.is... ] Ceki Gulcu edited comment on LBCORE-61 at 7/23/09 9:55 AM: ----------------------------------------------------------- Thank you for the precise analysis of the modularity problem in TimeBasedRollingPolicy due to the fact that it is both a TriggeringPolicy and a RollingPolicy. While I agree that there is a modularity issue, in particular respect to the elapsedPeriodFileName field, I don't see why anyone would reasonably want to combine a date based rolling policy with a size based triggering policy. You would get similar sized files each named by date. What is the use for that? While I would like to favorably respond to your request, the use-case (i.e. time based rolling policy with a size based triggering policy) just does not make sense to me. However, there are other users who have also asked for and also implemented size based triggering and date based rolling: - http://coding.derkeiler.com/Archive/Java/comp.lang.java.programmer/2006-02/m... - http://www.simonsite.org.uk/ was (Author: noreply.ceki@qos.ch): Thank you for the precise analysis of the modularity problem in TimeBasedRollingPolicy due to the fact that it is both a TriggeringPolicy and a RollingPolicy. While I agree that there is a modularity issue, in particular respect to the elapsedPeriodFileName field, I don't see why anyone would reasonably want to combine a date based rolling policy with a size based triggering policy. You would get similar sized files each named by date. What is the use for that? While I would like to favorably respond to your request, the use-case (i.e. time based rolling policy with a size based triggering policy) just does not make sense to me. However, there are other users who have also asked for size based triggering and date based rolling: - http://coding.derkeiler.com/Archive/Java/comp.lang.java.programmer/2006-02/m...
TimeBasedRollingPolicy can not be used with any other triggering policies -------------------------------------------------------------------------
Key: LBCORE-61 URL: http://jira.qos.ch/browse/LBCORE-61 Project: logback-core Issue Type: Bug Reporter: Szel Zoltan Assignee: Ceki Gulcu Priority: Critical
If someone would like to have a time based rolling policy with a size based triggering policy, than the user will get a NullPointerException,: at ch.qos.logback.core.rolling.helper.Compress.GZCompress(Compress.java:130) at ch.qos.logback.core.rolling.TimeBasedRollingPolicy.rollover(TimeBasedRollingPolicy.java:142) at ch.qos.logback.core.rolling.RollingFileAppender.rollover(RollingFileAppender.java:91) at ch.qos.logback.core.rolling.RollingFileAppender.subAppend(RollingFileAppender.java:116) at ch.qos.logback.core.WriterAppender.append(WriterAppender.java:124) at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:81) at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:51) at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:282) at ch.qos.logback.classic.Logger.callAppenders(Logger.java:266) at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:487) at ch.qos.logback.classic.Logger.filterAndLog(Logger.java:479) The cause of this issue is the isTriggeringEvent method in the TimeBasedRollingPolicy which has a side effect, namely it prepares the file name of the file which is about to rotate. If someone uses a triggering policy other than the same TimeBasedRollingPolicy, than the isTriggeringEvent method will not be called, hence the elapsedPeriodFileName will be null, hence a null pointer exception will be thrown in the start of the compression or while renaming. Please modify the isTriggeringEvent to not have this side effect + the rollover logic to capture the time information from the current event. Thanks, Zoltan
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCORE-61?page=com.atlassian.jira.plugin.system.is... ] Szel Zoltan commented on LBCORE-61: ----------------------------------- One of our use case is to be able to run post processing tools on log files. There are a couple of application in the company which produces huge amount of logs. We want to control the size of the log files so post processing tools will be able to handle them and also having the timestamp in the file name helps to determinate which business day that log file belongs to.
TimeBasedRollingPolicy can not be used with any other triggering policies -------------------------------------------------------------------------
Key: LBCORE-61 URL: http://jira.qos.ch/browse/LBCORE-61 Project: logback-core Issue Type: Bug Reporter: Szel Zoltan Assignee: Ceki Gulcu Priority: Critical
If someone would like to have a time based rolling policy with a size based triggering policy, than the user will get a NullPointerException,: at ch.qos.logback.core.rolling.helper.Compress.GZCompress(Compress.java:130) at ch.qos.logback.core.rolling.TimeBasedRollingPolicy.rollover(TimeBasedRollingPolicy.java:142) at ch.qos.logback.core.rolling.RollingFileAppender.rollover(RollingFileAppender.java:91) at ch.qos.logback.core.rolling.RollingFileAppender.subAppend(RollingFileAppender.java:116) at ch.qos.logback.core.WriterAppender.append(WriterAppender.java:124) at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:81) at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:51) at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:282) at ch.qos.logback.classic.Logger.callAppenders(Logger.java:266) at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:487) at ch.qos.logback.classic.Logger.filterAndLog(Logger.java:479) The cause of this issue is the isTriggeringEvent method in the TimeBasedRollingPolicy which has a side effect, namely it prepares the file name of the file which is about to rotate. If someone uses a triggering policy other than the same TimeBasedRollingPolicy, than the isTriggeringEvent method will not be called, hence the elapsedPeriodFileName will be null, hence a null pointer exception will be thrown in the start of the compression or while renaming. Please modify the isTriggeringEvent to not have this side effect + the rollover logic to capture the time information from the current event. Thanks, Zoltan
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCORE-61?page=com.atlassian.jira.plugin.system.is... ] Ceki Gulcu resolved LBCORE-61. ------------------------------ Fix Version/s: 0.9.17 Resolution: Fixed The TimeBasedTriggeringPolicy has been heavily refactored. It is now possible to trigger rolling by time as well as by size.
TimeBasedRollingPolicy can not be used with any other triggering policies -------------------------------------------------------------------------
Key: LBCORE-61 URL: http://jira.qos.ch/browse/LBCORE-61 Project: logback-core Issue Type: Bug Reporter: Szel Zoltan Assignee: Ceki Gulcu Priority: Critical Fix For: 0.9.17
If someone would like to have a time based rolling policy with a size based triggering policy, than the user will get a NullPointerException,: at ch.qos.logback.core.rolling.helper.Compress.GZCompress(Compress.java:130) at ch.qos.logback.core.rolling.TimeBasedRollingPolicy.rollover(TimeBasedRollingPolicy.java:142) at ch.qos.logback.core.rolling.RollingFileAppender.rollover(RollingFileAppender.java:91) at ch.qos.logback.core.rolling.RollingFileAppender.subAppend(RollingFileAppender.java:116) at ch.qos.logback.core.WriterAppender.append(WriterAppender.java:124) at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:81) at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:51) at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:282) at ch.qos.logback.classic.Logger.callAppenders(Logger.java:266) at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:487) at ch.qos.logback.classic.Logger.filterAndLog(Logger.java:479) The cause of this issue is the isTriggeringEvent method in the TimeBasedRollingPolicy which has a side effect, namely it prepares the file name of the file which is about to rotate. If someone uses a triggering policy other than the same TimeBasedRollingPolicy, than the isTriggeringEvent method will not be called, hence the elapsedPeriodFileName will be null, hence a null pointer exception will be thrown in the start of the compression or while renaming. Please modify the isTriggeringEvent to not have this side effect + the rollover logic to capture the time information from the current event. Thanks, Zoltan
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
participants (2)
-
Ceki Gulcu (JIRA)
-
Szel Zoltan (JIRA)