[JIRA] Created: (LBCORE-60) Allow rolling based on time or file size

Allow rolling based on time or file size ---------------------------------------- Key: LBCORE-60 URL: http://jira.qos.ch/browse/LBCORE-60 Project: logback-core Issue Type: New Feature Components: Appender Affects Versions: 0.9.9 Reporter: Szel Zoltan Assignee: Logback dev list The rolling grouping file appender allows to roll over on a specific interval(TimeBasedRollingPolicy) or when the log file has reached a specific file size. But unfortunately Logback does not support both to use together. For example if i want to roll over every day but i also want to roll the file when it is greater than 100MB. Please consider adding this feature to Logback and feel free to contact me if further clarification is required. Thanks, Zoltan Szel -- 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-60?page=com.atlassian.jira.plugin.system.is... ] Ceki Gulcu commented on LBCORE-60: ---------------------------------- Hello Szel, Have you seen LBCORE-11 ? It is now possible to instruct TimeBasedRollingPolicy to delete old files, thus controlling then number of archived log files.
Allow rolling based on time or file size ----------------------------------------
Key: LBCORE-60 URL: http://jira.qos.ch/browse/LBCORE-60 Project: logback-core Issue Type: New Feature Components: Appender Affects Versions: 0.9.9 Reporter: Szel Zoltan Assignee: Logback dev list
The rolling grouping file appender allows to roll over on a specific interval(TimeBasedRollingPolicy) or when the log file has reached a specific file size. But unfortunately Logback does not support both to use together. For example if i want to roll over every day but i also want to roll the file when it is greater than 100MB. Please consider adding this feature to Logback and feel free to contact me if further clarification is required. Thanks, Zoltan Szel
-- 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-60?page=com.atlassian.jira.plugin.system.is... ] Szel Zoltan commented on LBCORE-60: ----------------------------------- I am asking for a different thing. What i would like to be able to do is to tell the rollingappender to roll over every midnight, but if the output log file (the current one) has reached the size of 100MB than do an additional roll over. This is a kind of combining the timebased rolling policy with the sizebased triggering policy. What i think about is a kind of compound triggering policy. You can add several(2 in this case) triggering policies to it and in the isTriggeringEvent method the compound policy will ask the triggering policies iis it time to roll over. If one of them answers yes, than a rollover will happen. I hope this makes clearer what this issue is about. Thanks for your attention! Regards, Zoltan
Allow rolling based on time or file size ----------------------------------------
Key: LBCORE-60 URL: http://jira.qos.ch/browse/LBCORE-60 Project: logback-core Issue Type: New Feature Components: Appender Affects Versions: 0.9.9 Reporter: Szel Zoltan Assignee: Ceki Gulcu
The rolling grouping file appender allows to roll over on a specific interval(TimeBasedRollingPolicy) or when the log file has reached a specific file size. But unfortunately Logback does not support both to use together. For example if i want to roll over every day but i also want to roll the file when it is greater than 100MB. Please consider adding this feature to Logback and feel free to contact me if further clarification is required. Thanks, Zoltan Szel
-- 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-60?page=com.atlassian.jira.plugin.system.is... ] Ceki Gulcu commented on LBCORE-60: ---------------------------------- I was wondering if the policy described in LBCORE-11 would be sufficient for your needs. I understand that that policy is different than what you are asking for. So, could you live with just LBCORE-11 or do you strongly prefer a combined policy?
Allow rolling based on time or file size ----------------------------------------
Key: LBCORE-60 URL: http://jira.qos.ch/browse/LBCORE-60 Project: logback-core Issue Type: New Feature Components: Appender Affects Versions: 0.9.9 Reporter: Szel Zoltan Assignee: Ceki Gulcu
The rolling grouping file appender allows to roll over on a specific interval(TimeBasedRollingPolicy) or when the log file has reached a specific file size. But unfortunately Logback does not support both to use together. For example if i want to roll over every day but i also want to roll the file when it is greater than 100MB. Please consider adding this feature to Logback and feel free to contact me if further clarification is required. Thanks, Zoltan Szel
-- 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-60?page=com.atlassian.jira.plugin.system.is... ] Szel Zoltan commented on LBCORE-60: ----------------------------------- Unfortunately, that one is not sufficient for some of our developers. They want to rotate the logs at a fixed time to be able to run a batched job on them , but the other hand they want to control the file size so handling tools (eg emacs) can load with ease. Please consider adding this feature to Logback. Thanks very much, Zoltan
Allow rolling based on time or file size ----------------------------------------
Key: LBCORE-60 URL: http://jira.qos.ch/browse/LBCORE-60 Project: logback-core Issue Type: New Feature Components: Appender Affects Versions: 0.9.9 Reporter: Szel Zoltan Assignee: Ceki Gulcu
The rolling grouping file appender allows to roll over on a specific interval(TimeBasedRollingPolicy) or when the log file has reached a specific file size. But unfortunately Logback does not support both to use together. For example if i want to roll over every day but i also want to roll the file when it is greater than 100MB. Please consider adding this feature to Logback and feel free to contact me if further clarification is required. Thanks, Zoltan Szel
-- 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-60?page=com.atlassian.jira.plugin.system.is... ] Ceki Gulcu resolved LBCORE-60. ------------------------------ Resolution: Won't Fix Hello Szel, The MaxHistory property in TimeBasedRollingPolicy can accommodate the needs of most users. If you need to have smaller files, then try a shorter rollover period, for example, daily rollover instead of weekly. The RollingFileAppender code is already pretty complicated. I don't wish to render it unmanageable. Consequently, I am marking this issue as WONT FIX as opposed to having it rot for eons.
Allow rolling based on time or file size ----------------------------------------
Key: LBCORE-60 URL: http://jira.qos.ch/browse/LBCORE-60 Project: logback-core Issue Type: New Feature Components: Appender Affects Versions: 0.9.9 Reporter: Szel Zoltan Assignee: Ceki Gulcu
The rolling grouping file appender allows to roll over on a specific interval(TimeBasedRollingPolicy) or when the log file has reached a specific file size. But unfortunately Logback does not support both to use together. For example if i want to roll over every day but i also want to roll the file when it is greater than 100MB. Please consider adding this feature to Logback and feel free to contact me if further clarification is required. Thanks, Zoltan Szel
-- 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-60?page=com.atlassian.jira.plugin.system.is... ] Szel Zoltan commented on LBCORE-60: ----------------------------------- Hi Ceki, I am very sad seeing this issue be closed :-( In most of our applications logging is also used for auditing because of legal purposes. Those applications logs at a very high level(sometimes 2-3GB/DAY !!!). The current logging solution they use allows this feature where they can make chunks of their huge amount of logging data which can be processed with a script after business hours. Without this we can not recommend them to use Logback which might change our long term strategic decision on moving to this good product in the entire firm(There are 4 groups forcing me to get this feature in place). The feature i am requesting would not have a big effect on the RollingFileAppender code, it is mostly related to this other issue with the TimeBasedRollingPolicy(http://jira.qos.ch/browse/LBCORE-61). With the fix for the LBCORE-61 issue in place implementing this compound triggering policy would be trivial. Googling a bit i have found the CompositeRollingAppender from Log4j which seems to me to provide the same functionality with rollingstyle=3(correct me if i am wrong i do not have too much experience with Log4j). I wonder why this feature is not good enough to be in Logback. Please consider reopening this issue. Thanks in advance, Zoltan
Allow rolling based on time or file size ----------------------------------------
Key: LBCORE-60 URL: http://jira.qos.ch/browse/LBCORE-60 Project: logback-core Issue Type: New Feature Components: Appender Affects Versions: 0.9.9 Reporter: Szel Zoltan Assignee: Ceki Gulcu
The rolling grouping file appender allows to roll over on a specific interval(TimeBasedRollingPolicy) or when the log file has reached a specific file size. But unfortunately Logback does not support both to use together. For example if i want to roll over every day but i also want to roll the file when it is greater than 100MB. Please consider adding this feature to Logback and feel free to contact me if further clarification is required. Thanks, Zoltan Szel
-- 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-60?page=com.atlassian.jira.plugin.system.is... ] Leung Wang Hei updated LBCORE-60: --------------------------------- Attachment: SizeTimeBasedRolloingPolicy-0.9.9-src.rar A combination of TimeBasedRollingPolicy and SizeBasedTriggeringPolicy * * * Rollover occurs if: * * 1. Over a time period; * 2. File size excced predefined limit; or * 3. After a time point in the first time (Optional, see {@link #setRequireFirstCheck(boolean)}) * * In case (3), for file pattern set to rolloever per Hour/Date/Month, first time rollover occurs if the log file last modified date is before the 1st * minute/1st hour/1st day of the month even time elapsed is less than 60 minutes/24 hours/30 days. * * * E.g. It is now 16:23 and the log file is lastly modified at 15:59. Elapsed time is less than 60 minutes but with {@link #requireFirstCheck} set as * True, a hourly rollover policy rolls the log file and rename it with the last modified time. * * * Sample logback.xml file: * * <pre> * <rollingPolicy class="ch.qos.logback.core.rolling.SizeTimeBasedRollingPolicy"> * <FileNamePattern> * TestApp-%d{HH.mm}.log * </FileNamePattern> * <MaxFileSize>1000</MaxFileSize> <!--Same convention as in {@link SizeBasedTriggeringPolicy}, e.g. 1000, 10KB, 10MB, 10GB --> * <requiredFirstCheck>FALSE</requiredFirstCheck> * </rollingPolicy> * </pre> * * * A typical list of generated files in chronicle order shall be like this : * * <pre> * TestApp-16.48-1.log * TestApp-16.48-2.log * TestApp-16.48.log * TestApp-16.49-1.log * TestApp-16.49-2.log * TestApp-16.49-3.log * TestApp-16.49-4.log * TestApp-16.49-5.log * TestApp-16.49-6.log * TestApp-16.49.log * TestApp-16-50-1.log * </pre>
Allow rolling based on time or file size ----------------------------------------
Key: LBCORE-60 URL: http://jira.qos.ch/browse/LBCORE-60 Project: logback-core Issue Type: New Feature Components: Appender Affects Versions: 0.9.9 Reporter: Szel Zoltan Assignee: Ceki Gulcu Attachments: SizeTimeBasedRolloingPolicy-0.9.9-src.rar
The rolling grouping file appender allows to roll over on a specific interval(TimeBasedRollingPolicy) or when the log file has reached a specific file size. But unfortunately Logback does not support both to use together. For example if i want to roll over every day but i also want to roll the file when it is greater than 100MB. Please consider adding this feature to Logback and feel free to contact me if further clarification is required. Thanks, Zoltan Szel
-- 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-60?page=com.atlassian.jira.plugin.system.is... ] Leung Wang Hei commented on LBCORE-60: -------------------------------------- I have wrote a temp. solution for this. The code is a bit dirty though. Free feel let me know for any bugs there.
Allow rolling based on time or file size ----------------------------------------
Key: LBCORE-60 URL: http://jira.qos.ch/browse/LBCORE-60 Project: logback-core Issue Type: New Feature Components: Appender Affects Versions: 0.9.9 Reporter: Szel Zoltan Assignee: Ceki Gulcu Attachments: SizeTimeBasedRolloingPolicy-0.9.9-src.rar
The rolling grouping file appender allows to roll over on a specific interval(TimeBasedRollingPolicy) or when the log file has reached a specific file size. But unfortunately Logback does not support both to use together. For example if i want to roll over every day but i also want to roll the file when it is greater than 100MB. Please consider adding this feature to Logback and feel free to contact me if further clarification is required. Thanks, Zoltan Szel
-- 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-60?page=com.atlassian.jira.plugin.system.is... ] Johan Bos commented on LBCORE-60: --------------------------------- Thanks for the lib, I think that the class was compiled for Java 1.6, though logback minimum requirements is Java 1.5 So just in case people wonder why they got a: Failed to instantiate [ch.qos.logback.classic.LoggerContext] Reported exception: java.lang.UnsupportedClassVersionError: Bad version number in .class file But still, thanks for the functionality, it helps for those passing from log4j to logback... could see this as a drawback
Allow rolling based on time or file size ----------------------------------------
Key: LBCORE-60 URL: http://jira.qos.ch/browse/LBCORE-60 Project: logback-core Issue Type: New Feature Components: Appender Affects Versions: 0.9.9 Reporter: Szel Zoltan Assignee: Ceki Gulcu Attachments: SizeTimeBasedRolloingPolicy-0.9.9-src.rar
The rolling grouping file appender allows to roll over on a specific interval(TimeBasedRollingPolicy) or when the log file has reached a specific file size. But unfortunately Logback does not support both to use together. For example if i want to roll over every day but i also want to roll the file when it is greater than 100MB. Please consider adding this feature to Logback and feel free to contact me if further clarification is required. Thanks, Zoltan Szel
-- 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 (4)
-
Ceki Gulcu (JIRA)
-
Johan Bos (JIRA)
-
Leung Wang Hei (JIRA)
-
Szel Zoltan (JIRA)