FileAppender

Inheritance: java.lang.Object, com.aspose.email.Appender

public final class FileAppender extends Appender

Reprensents a file appender.

Constructors

Constructor Description
FileAppender() Initializes a new instance of the FileAppender class.
FileAppender(String fileName) Initializes a new instance of the FileAppender class.
FileAppender(String fileName, boolean useDate) Initializes a new instance of the FileAppender class.
FileAppender(String fileName, IFormatter formatter) Initializes a new instance of the FileAppender class.
FileAppender(String fileName, boolean useDate, IFormatter formatter) Initializes a new instance of the FileAppender class.

Methods

Method Description
getFileName() Gets or sets file name.
setFileName(String value) Gets or sets file name.
getUseDate() Gets or sets value which indicates whether date is used for logging.
setUseDate(boolean value) Gets or sets value which indicates whether date is used for logging.
getEncoding() Gets or sets the encoding.
setEncoding(String value) Gets or sets the encoding.
append(LogEntry logEntry) Appends the log entry information to the appender.
appendHeader() Starts log file with specific header.
append(LogEntry[] logEntries) Appends a set of log entries to the appender.
close() Closes the appender.

FileAppender()

public FileAppender()

Initializes a new instance of the FileAppender class.

FileAppender(String fileName)

public FileAppender(String fileName)

Initializes a new instance of the FileAppender class.

Parameters:

Parameter Type Description
fileName java.lang.String The file name.

FileAppender(String fileName, boolean useDate)

public FileAppender(String fileName, boolean useDate)

Initializes a new instance of the FileAppender class.

Parameters:

Parameter Type Description
fileName java.lang.String The file name.
useDate boolean Indicates if date is used in file name

FileAppender(String fileName, IFormatter formatter)

public FileAppender(String fileName, IFormatter formatter)

Initializes a new instance of the FileAppender class.

Parameters:

Parameter Type Description
fileName java.lang.String The file name.
formatter IFormatter Log formatter

FileAppender(String fileName, boolean useDate, IFormatter formatter)

public FileAppender(String fileName, boolean useDate, IFormatter formatter)

Initializes a new instance of the FileAppender class.

Parameters:

Parameter Type Description
fileName java.lang.String The file name.
useDate boolean Indicates if date is used in file name
formatter IFormatter Log formatter

getFileName()

public final String getFileName()

Gets or sets file name.

Returns: java.lang.String

setFileName(String value)

public final void setFileName(String value)

Gets or sets file name.

Parameters:

Parameter Type Description
value java.lang.String

getUseDate()

public final boolean getUseDate()

Gets or sets value which indicates whether date is used for logging.

Returns: boolean

setUseDate(boolean value)

public final void setUseDate(boolean value)

Gets or sets value which indicates whether date is used for logging.

Parameters:

Parameter Type Description
value boolean

getEncoding()

public final String getEncoding()

Gets or sets the encoding.

Returns: java.lang.String

setEncoding(String value)

public final void setEncoding(String value)

Gets or sets the encoding.

Parameters:

Parameter Type Description
value java.lang.String

append(LogEntry logEntry)

public void append(LogEntry logEntry)

Appends the log entry information to the appender.

Parameters:

Parameter Type Description
logEntry LogEntry The log entry.

appendHeader()

public void appendHeader()

Starts log file with specific header.

append(LogEntry[] logEntries)

public final void append(LogEntry[] logEntries)

Appends a set of log entries to the appender.

Parameters:

Parameter Type Description
logEntries com.aspose.email.LogEntry[] A set of log entries to log.

close()

public void close()

Closes the appender.