Class DirectWriteRolloverStrategy.Builder
- java.lang.Object
-
- org.apache.logging.log4j.core.appender.rolling.DirectWriteRolloverStrategy.Builder
-
- All Implemented Interfaces:
Builder<DirectWriteRolloverStrategy>
- Enclosing class:
- DirectWriteRolloverStrategy
public static class DirectWriteRolloverStrategy.Builder extends java.lang.Object implements Builder<DirectWriteRolloverStrategy>
Builds DirectWriteRolloverStrategy instances.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringcompressionLevelStrprivate Configurationconfigprivate Action[]customActionsprivate java.lang.StringmaxFilesprivate booleanstopCustomActionsOnErrorprivate java.lang.StringtempCompressedFilePattern
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DirectWriteRolloverStrategybuild()Builds the object after all configuration has been set.java.lang.StringgetCompressionLevelStr()ConfigurationgetConfig()Action[]getCustomActions()java.lang.StringgetMaxFiles()java.lang.StringgetTempCompressedFilePattern()booleanisStopCustomActionsOnError()DirectWriteRolloverStrategy.BuilderwithCompressionLevelStr(java.lang.String compressionLevelStr)Defines compression level.DirectWriteRolloverStrategy.BuilderwithConfig(Configuration config)Defines configuration.DirectWriteRolloverStrategy.BuilderwithCustomActions(Action[] customActions)Defines custom actions.DirectWriteRolloverStrategy.BuilderwithMaxFiles(java.lang.String maxFiles)Defines the maximum number of files to keep.DirectWriteRolloverStrategy.BuilderwithStopCustomActionsOnError(boolean stopCustomActionsOnError)Defines whether to stop executing asynchronous actions if an error occurs.DirectWriteRolloverStrategy.BuilderwithTempCompressedFilePattern(java.lang.String tempCompressedFilePattern)Defines temporary compression file pattern.-
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
-
-
-
-
Field Detail
-
maxFiles
@PluginBuilderAttribute("maxFiles") private java.lang.String maxFiles
-
compressionLevelStr
@PluginBuilderAttribute("compressionLevel") private java.lang.String compressionLevelStr
-
customActions
@PluginElement("Actions") private Action[] customActions
-
stopCustomActionsOnError
@PluginBuilderAttribute("stopCustomActionsOnError") private boolean stopCustomActionsOnError
-
tempCompressedFilePattern
@PluginBuilderAttribute("tempCompressedFilePattern") private java.lang.String tempCompressedFilePattern
-
config
@PluginConfiguration private Configuration config
-
-
Method Detail
-
build
public DirectWriteRolloverStrategy 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<DirectWriteRolloverStrategy>- Returns:
- the configured instance.
-
getMaxFiles
public java.lang.String getMaxFiles()
-
withMaxFiles
public DirectWriteRolloverStrategy.Builder withMaxFiles(java.lang.String maxFiles)
Defines the maximum number of files to keep.- Parameters:
maxFiles- The maximum number of files that match the date portion of the pattern to keep.- Returns:
- This builder for chaining convenience
-
getCompressionLevelStr
public java.lang.String getCompressionLevelStr()
-
withCompressionLevelStr
public DirectWriteRolloverStrategy.Builder withCompressionLevelStr(java.lang.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
-
getCustomActions
public Action[] getCustomActions()
-
withCustomActions
public DirectWriteRolloverStrategy.Builder withCustomActions(Action[] customActions)
Defines custom actions.- Parameters:
customActions- custom actions to perform asynchronously after rollover- Returns:
- This builder for chaining convenience
-
isStopCustomActionsOnError
public boolean isStopCustomActionsOnError()
-
withStopCustomActionsOnError
public DirectWriteRolloverStrategy.Builder withStopCustomActionsOnError(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
-
getTempCompressedFilePattern
public java.lang.String getTempCompressedFilePattern()
-
withTempCompressedFilePattern
public DirectWriteRolloverStrategy.Builder withTempCompressedFilePattern(java.lang.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
-
getConfig
public Configuration getConfig()
-
withConfig
public DirectWriteRolloverStrategy.Builder withConfig(Configuration config)
Defines configuration.- Parameters:
config- The Configuration.- Returns:
- This builder for chaining convenience
-
-