[JIRA] Created: (LBCORE-91) Add new TriggeringPolicy class to cause one rollover at the start of each run

Add new TriggeringPolicy class to cause one rollover at the start of each run ----------------------------------------------------------------------------- Key: LBCORE-91 URL: http://jira.qos.ch/browse/LBCORE-91 Project: logback-core Issue Type: New Feature Components: Appender Affects Versions: 0.9.15 Environment: - Reporter: Rick Beton Assignee: Logback dev list Priority: Minor A new TriggeringPolicy will cause the logfile to rollover once at startup when used with FixedWindowRollingPolicy. This is useful during development so that the logfiles of recent runs are still available. Here is a candidate implementation. Note that * <append>true</append> is required - otherwise the previous file is overwritten before rollover happens, so rollover results in a useless list of empty files. * the documentation would need to warn users of the effect of running multiple applications concurrently (i.e. concurrent operating system processes) with the same logfiles. This applies even without the suggested feature. package ch.qos.logback.core.rolling; import java.io.File; import ch.qos.logback.core.rolling.TriggeringPolicyBase; /** * SimpleStartupTriggeringPolicy triggers a rollover once at startup only. This * is useful for preserving older logfiles during development. * * @author Rick Beton */ public final class SimpleStartupTriggeringPolicy<E> extends TriggeringPolicyBase<E> { private boolean fired = false; public SimpleStartupTriggeringPolicy () { // does nothing } public boolean isTriggeringEvent( final File activeFile, final E event ) { final boolean result = !fired && (activeFile.length() > 0); fired = true; if (result) { addInfo( "Triggering rollover for " + activeFile ); } return result; } } -- 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-91?page=com.atlassian.jira.plugin.system.is... ] Szel Zoltan commented on LBCORE-91: ----------------------------------- Hi all, i also would like to request this feature, given that it is very importan for short lived applications where having a new log file at every startup is really what people needs. Please consider implementing this change as soon as possible.
Add new TriggeringPolicy class to cause one rollover at the start of each run -----------------------------------------------------------------------------
Key: LBCORE-91 URL: http://jira.qos.ch/browse/LBCORE-91 Project: logback-core Issue Type: New Feature Components: Appender Affects Versions: 0.9.15 Environment: - Reporter: Rick Beton Assignee: Logback dev list Priority: Minor
A new TriggeringPolicy will cause the logfile to rollover once at startup when used with FixedWindowRollingPolicy. This is useful during development so that the logfiles of recent runs are still available. Here is a candidate implementation. Note that * <append>true</append> is required - otherwise the previous file is overwritten before rollover happens, so rollover results in a useless list of empty files. * the documentation would need to warn users of the effect of running multiple applications concurrently (i.e. concurrent operating system processes) with the same logfiles. This applies even without the suggested feature. package ch.qos.logback.core.rolling; import java.io.File; import ch.qos.logback.core.rolling.TriggeringPolicyBase; /** * SimpleStartupTriggeringPolicy triggers a rollover once at startup only. This * is useful for preserving older logfiles during development. * * @author Rick Beton */ public final class SimpleStartupTriggeringPolicy<E> extends TriggeringPolicyBase<E> { private boolean fired = false; public SimpleStartupTriggeringPolicy () { // does nothing } public boolean isTriggeringEvent( final File activeFile, final E event ) { final boolean result = !fired && (activeFile.length() > 0); fired = true; if (result) { addInfo( "Triggering rollover for " + activeFile ); } return result; } }
-- 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-91?page=com.atlassian.jira.plugin.system.is... ] Ceki Gulcu updated LBCORE-91: ----------------------------- Priority: Major (was: Minor) I agree that archiving log files at every start-up would be a useful feature. This could be as easy as creating a new log file with a name containing the date and time when application started.
Add new TriggeringPolicy class to cause one rollover at the start of each run -----------------------------------------------------------------------------
Key: LBCORE-91 URL: http://jira.qos.ch/browse/LBCORE-91 Project: logback-core Issue Type: New Feature Components: Appender Affects Versions: 0.9.15 Environment: - Reporter: Rick Beton Assignee: Ceki Gulcu
A new TriggeringPolicy will cause the logfile to rollover once at startup when used with FixedWindowRollingPolicy. This is useful during development so that the logfiles of recent runs are still available. Here is a candidate implementation. Note that * <append>true</append> is required - otherwise the previous file is overwritten before rollover happens, so rollover results in a useless list of empty files. * the documentation would need to warn users of the effect of running multiple applications concurrently (i.e. concurrent operating system processes) with the same logfiles. This applies even without the suggested feature. package ch.qos.logback.core.rolling; import java.io.File; import ch.qos.logback.core.rolling.TriggeringPolicyBase; /** * SimpleStartupTriggeringPolicy triggers a rollover once at startup only. This * is useful for preserving older logfiles during development. * * @author Rick Beton */ public final class SimpleStartupTriggeringPolicy<E> extends TriggeringPolicyBase<E> { private boolean fired = false; public SimpleStartupTriggeringPolicy () { // does nothing } public boolean isTriggeringEvent( final File activeFile, final E event ) { final boolean result = !fired && (activeFile.length() > 0); fired = true; if (result) { addInfo( "Triggering rollover for " + activeFile ); } return result; } }
-- 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-91?page=com.atlassian.jira.plugin.system.is... ] Ceki Gulcu edited comment on LBCORE-91 at 7/22/09 10:18 PM: ------------------------------------------------------------ I agree that creating a new log file at application start-up would be a useful feature. This could be as easy as creating a new log file with a name containing the date and time when application started. Note that no rollover is necessary to implement this functionality. was (Author: noreply.ceki@qos.ch): I agree that archiving log files at every start-up would be a useful feature. This could be as easy as creating a new log file with a name containing the date and time when application started.
Add new TriggeringPolicy class to cause one rollover at the start of each run -----------------------------------------------------------------------------
Key: LBCORE-91 URL: http://jira.qos.ch/browse/LBCORE-91 Project: logback-core Issue Type: New Feature Components: Appender Affects Versions: 0.9.15 Environment: - Reporter: Rick Beton Assignee: Ceki Gulcu
A new TriggeringPolicy will cause the logfile to rollover once at startup when used with FixedWindowRollingPolicy. This is useful during development so that the logfiles of recent runs are still available. Here is a candidate implementation. Note that * <append>true</append> is required - otherwise the previous file is overwritten before rollover happens, so rollover results in a useless list of empty files. * the documentation would need to warn users of the effect of running multiple applications concurrently (i.e. concurrent operating system processes) with the same logfiles. This applies even without the suggested feature. package ch.qos.logback.core.rolling; import java.io.File; import ch.qos.logback.core.rolling.TriggeringPolicyBase; /** * SimpleStartupTriggeringPolicy triggers a rollover once at startup only. This * is useful for preserving older logfiles during development. * * @author Rick Beton */ public final class SimpleStartupTriggeringPolicy<E> extends TriggeringPolicyBase<E> { private boolean fired = false; public SimpleStartupTriggeringPolicy () { // does nothing } public boolean isTriggeringEvent( final File activeFile, final E event ) { final boolean result = !fired && (activeFile.length() > 0); fired = true; if (result) { addInfo( "Triggering rollover for " + activeFile ); } return result; } }
-- 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-91?page=com.atlassian.jira.plugin.system.is... ] Ceki Gulcu resolved LBCORE-91. ------------------------------ Fix Version/s: 0.9.17 Resolution: Fixed This issue has been solved in revision 2427.
Add new TriggeringPolicy class to cause one rollover at the start of each run -----------------------------------------------------------------------------
Key: LBCORE-91 URL: http://jira.qos.ch/browse/LBCORE-91 Project: logback-core Issue Type: New Feature Components: Appender Affects Versions: 0.9.15 Environment: - Reporter: Rick Beton Assignee: Ceki Gulcu Fix For: 0.9.17
A new TriggeringPolicy will cause the logfile to rollover once at startup when used with FixedWindowRollingPolicy. This is useful during development so that the logfiles of recent runs are still available. Here is a candidate implementation. Note that * <append>true</append> is required - otherwise the previous file is overwritten before rollover happens, so rollover results in a useless list of empty files. * the documentation would need to warn users of the effect of running multiple applications concurrently (i.e. concurrent operating system processes) with the same logfiles. This applies even without the suggested feature. package ch.qos.logback.core.rolling; import java.io.File; import ch.qos.logback.core.rolling.TriggeringPolicyBase; /** * SimpleStartupTriggeringPolicy triggers a rollover once at startup only. This * is useful for preserving older logfiles during development. * * @author Rick Beton */ public final class SimpleStartupTriggeringPolicy<E> extends TriggeringPolicyBase<E> { private boolean fired = false; public SimpleStartupTriggeringPolicy () { // does nothing } public boolean isTriggeringEvent( final File activeFile, final E event ) { final boolean result = !fired && (activeFile.length() > 0); fired = true; if (result) { addInfo( "Triggering rollover for " + activeFile ); } return result; } }
-- 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 (3)
-
Ceki Gulcu (JIRA)
-
Rick Beton (JIRA)
-
Szel Zoltan (JIRA)