[logback-dev] rolling policy with starting new file on system startup

Hontvari Jozsef hontvari3 at solware.com
Thu Sep 27 21:22:26 CEST 2007


I would add an option to the rolling appender to start a new file not
only when the trigger fires but also when the system is started.
This doesn't seem to be a difficult task but there are several possible
solutions:

-it can be an option of the current trigger implementations. As I know
actually there is only one trigger implementation, the other trigger
type is only implicitly used with time based rolling

-it can be a standalone trigger, this is also useful if we don't want to
limit the size of the log file

-there is an existing attribute of the file appender, named "append".
This attribute already has a very similar (the same?) meaning. It causes
to start a new log file on startup (i.e. delete its previous content).
Currently if this "append" attribute is switched on then the rolling
appender literally follows the previous definition and it overwrites the
previous content of the last file, instead of rolling the last file.  It
is unlikely that this is what the user wants.

For me the last alternative seems to be the best. What do you think?





More information about the logback-dev mailing list