Does logback or log4j2 provide other FileAppenders/alternatives
log4j2 introduces RandomAccessFileAppender
and RollingRandomAccessFileAppender
which are still experimental, may replace FileAppender
and RollingFileAppender
in a future release. See here.
However current RollingFileAppender
requires a TriggeringPolicy
:
OnStartup Triggering Policy: The OnStartup policy takes no parameters and causes a rollover if the log file is older than the current JVM's start time.
SizeBased Triggering Policy: Causes a rollover once the file has reached the specified size. The size can be specified in bytes, KB, MB or GB.
TimeBased Triggering Policy: Causes a rollover once the date/time pattern no longer applies to the active file. This policy accepts an "increment" attribute which indicates how frequently the rollover should occur based on the time pattern and a "modulate" boolean attribute.