Class FileAppenderConfig
- java.lang.Object
-
- org.arakhne.afc.bootique.log4j.configs.AppenderConfig
-
- org.arakhne.afc.bootique.log4j.configs.FileAppenderConfig
-
- All Implemented Interfaces:
io.bootique.config.PolymorphicConfiguration
public class FileAppenderConfig extends AppenderConfig
Configuration for a console-based log4j appenders.- Since:
- 15.0
- Version:
- 17.0 2020-01-04 14:41:57
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.bootique
- Maven Artifact Id:
- bootique-log4j
-
-
Constructor Summary
Constructors Constructor Description FileAppenderConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.log4j.AppendercreateAppender(String defaultLogFormat)Create an appender with the current configuration.booleangetAppend()Replies if the appender writes at the end of the existing file or not.StringgetEncoding()Replies the console encoding.FilegetFile()Replies the target file.booleangetImmediateFlush()Replies if the text is flushed as soon as it it given to the logger.LevelgetThreshold()Replies if the text is flushed as soon as it it given to the logger.voidsetAppend(boolean append)Set if the appender writes at the end of the existing file or not.voidsetEncoding(String encoding)Change the console encoding.voidsetFile(File file)Change the target file.voidsetImmediateFlush(boolean flush)Change if the text is flushed as soon as it it given to the logger.voidsetThreshold(Level threshold)Set the threshold level.-
Methods inherited from class org.arakhne.afc.bootique.log4j.configs.AppenderConfig
createLayout, getLayout, getLogFormat, setLayout, setLogFormat
-
-
-
-
Method Detail
-
getFile
public File getFile()
Replies the target file.- Returns:
- the target.
-
setFile
public void setFile(File file)
Change the target file.- Parameters:
file- the target.
-
getAppend
public boolean getAppend()
Replies if the appender writes at the end of the existing file or not.- Returns:
trueif log messages are appended at the end of thefile,falseif the previous content of the file is destroyed.
-
setAppend
public void setAppend(boolean append)
Set if the appender writes at the end of the existing file or not.- Parameters:
append-trueif log messages are appended at the end of thefile,falseif the previous content of the file is destroyed.
-
getEncoding
public String getEncoding()
Replies the console encoding.- Returns:
- the encoding.
-
setEncoding
public void setEncoding(String encoding)
Change the console encoding.- Parameters:
encoding- the console encoding.
-
getImmediateFlush
public boolean getImmediateFlush()
Replies if the text is flushed as soon as it it given to the logger.- Returns:
truefor immediate flushing.
-
setImmediateFlush
public void setImmediateFlush(boolean flush)
Change if the text is flushed as soon as it it given to the logger.- Parameters:
flush-truefor immediate flushing.
-
getThreshold
public Level getThreshold()
Replies if the text is flushed as soon as it it given to the logger.- Returns:
truefor immediate flushing.
-
setThreshold
public void setThreshold(Level threshold)
Set the threshold level. All log events with lower level than the threshold level are ignored by the appender.- Parameters:
threshold- the threshold level.
-
createAppender
public org.apache.log4j.Appender createAppender(String defaultLogFormat)
Description copied from class:AppenderConfigCreate an appender with the current configuration.- Specified by:
createAppenderin classAppenderConfig- Parameters:
defaultLogFormat- the default log format.- Returns:
- the appender.
-
-