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.Appender
createAppender(String defaultLogFormat)
Create an appender with the current configuration.boolean
getAppend()
Replies if the appender writes at the end of the existing file or not.String
getEncoding()
Replies the console encoding.File
getFile()
Replies the target file.boolean
getImmediateFlush()
Replies if the text is flushed as soon as it it given to the logger.Level
getThreshold()
Replies if the text is flushed as soon as it it given to the logger.void
setAppend(boolean append)
Set if the appender writes at the end of the existing file or not.void
setEncoding(String encoding)
Change the console encoding.void
setFile(File file)
Change the target file.void
setImmediateFlush(boolean flush)
Change if the text is flushed as soon as it it given to the logger.void
setThreshold(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:
true
if log messages are appended at the end of thefile,false
if 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
-true
if log messages are appended at the end of thefile,false
if 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:
true
for 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
-true
for immediate flushing.
-
getThreshold
public Level getThreshold()
Replies if the text is flushed as soon as it it given to the logger.- Returns:
true
for 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:AppenderConfig
Create an appender with the current configuration.- Specified by:
createAppender
in classAppenderConfig
- Parameters:
defaultLogFormat
- the default log format.- Returns:
- the appender.
-
-