
[ 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