Class DefaultRolloverStrategy.Builder
- java.lang.Object
-
- org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy.Builder
-
- All Implemented Interfaces:
Builder<DefaultRolloverStrategy>
- Enclosing class:
- DefaultRolloverStrategy
public static class DefaultRolloverStrategy.Builder extends Object implements Builder<DefaultRolloverStrategy>
Builds DefaultRolloverStrategy instances.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.logging.log4j.core.util.Builder
getErrorPrefix, isValid
-
-
-
-
Method Detail
-
build
public DefaultRolloverStrategy build()
Description copied from interface:BuilderBuilds the object after all configuration has been set. This will use default values for any unspecified attributes for the object.- Specified by:
buildin interfaceBuilder<DefaultRolloverStrategy>- Returns:
- the configured instance.
-
getMax
public String getMax()
-
setMax
public DefaultRolloverStrategy.Builder setMax(String max)
Defines the maximum number of files to keep.- Parameters:
max- The maximum number of files to keep.- Returns:
- This builder for chaining convenience
- Since:
- 2.26.0
-
getMin
public String getMin()
-
setMin
public DefaultRolloverStrategy.Builder setMin(String min)
Defines the minimum number of files to keep.- Parameters:
min- The minimum number of files to keep.- Returns:
- This builder for chaining convenience
- Since:
- 2.26.0
-
getFileIndex
public String getFileIndex()
-
setFileIndex
public DefaultRolloverStrategy.Builder setFileIndex(String fileIndex)
Defines the file index for rolling strategy.- Parameters:
fileIndex- If set to "max" (the default), files with a higher index will be newer than files with a smaller index. If set to "min", file renaming and the counter will follow the Fixed Window strategy.- Returns:
- This builder for chaining convenience
- Since:
- 2.26.0
-
getCompressionLevelStr
public String getCompressionLevelStr()
-
setCompressionLevelStr
public DefaultRolloverStrategy.Builder setCompressionLevelStr(String compressionLevelStr)
Defines compression level.- Parameters:
compressionLevelStr- The compression level, 0 (less) through 9 (more); applies only to ZIP files.- Returns:
- This builder for chaining convenience
- Since:
- 2.26.0
-
getCustomActions
public Action[] getCustomActions()
-
setCustomActions
public DefaultRolloverStrategy.Builder setCustomActions(Action[] customActions)
Defines custom actions.- Parameters:
customActions- custom actions to perform asynchronously after rollover- Returns:
- This builder for chaining convenience
- Since:
- 2.26.0
-
isStopCustomActionsOnError
public boolean isStopCustomActionsOnError()
-
setStopCustomActionsOnError
public DefaultRolloverStrategy.Builder setStopCustomActionsOnError(boolean stopCustomActionsOnError)
Defines whether to stop executing asynchronous actions if an error occurs.- Parameters:
stopCustomActionsOnError- whether to stop executing asynchronous actions if an error occurs- Returns:
- This builder for chaining convenience
- Since:
- 2.26.0
-
getTempCompressedFilePattern
public String getTempCompressedFilePattern()
-
setTempCompressedFilePattern
public DefaultRolloverStrategy.Builder setTempCompressedFilePattern(String tempCompressedFilePattern)
Defines temporary compression file pattern.- Parameters:
tempCompressedFilePattern- File pattern of the working file pattern used during compression, if null no temporary file are used- Returns:
- This builder for chaining convenience
- Since:
- 2.26.0
-
getConfig
public Configuration getConfig()
-
setConfig
public DefaultRolloverStrategy.Builder setConfig(Configuration config)
Defines configuration.- Parameters:
config- The Configuration.- Returns:
- This builder for chaining convenience
- Since:
- 2.26.0
-
withMax
@Deprecated public DefaultRolloverStrategy.Builder withMax(String max)
Deprecated.since 2.26.0 usesetMax(String).
-
withMin
@Deprecated public DefaultRolloverStrategy.Builder withMin(String min)
Deprecated.since 2.26.0 usesetMin(String).
-
withFileIndex
@Deprecated public DefaultRolloverStrategy.Builder withFileIndex(String fileIndex)
Deprecated.since 2.26.0 usesetFileIndex(String).
-
withCompressionLevelStr
@Deprecated public DefaultRolloverStrategy.Builder withCompressionLevelStr(String compressionLevelStr)
Deprecated.since 2.26.0 usesetCompressionLevelStr(String).
-
withCustomActions
@Deprecated public DefaultRolloverStrategy.Builder withCustomActions(Action[] customActions)
Deprecated.since 2.26.0 usesetCustomActions(Action[]).
-
withStopCustomActionsOnError
@Deprecated public DefaultRolloverStrategy.Builder withStopCustomActionsOnError(boolean stopCustomActionsOnError)
Deprecated.since 2.26.0 usesetStopCustomActionsOnError(boolean).
-
withTempCompressedFilePattern
@Deprecated public DefaultRolloverStrategy.Builder withTempCompressedFilePattern(String tempCompressedFilePattern)
Deprecated.since 2.26.0 usesetTempCompressedFilePattern(String).
-
withConfig
@Deprecated public DefaultRolloverStrategy.Builder withConfig(Configuration config)
Deprecated.since 2.26.0 usesetConfig(Configuration).
-
-