public class FileLogger extends Object implements com.groupdocs.foundation.logging.ILogger
Should be used together with ComparisonLogger.
Example usage:
ComparisonLogger.setLogger(new FileLogger("/path/to/file.log.txt", false, true, true, true));
ComparisonLogger| Modifier and Type | Field and Description |
|---|---|
static String |
EXCEPTION |
static String |
MESSAGE |
| Constructor and Description |
|---|
FileLogger(String filePath)
Initializes a new instance of the FileLogger class with file path.
|
FileLogger(String filePath,
boolean isTraceEnabled,
boolean isDebugEnabled,
boolean isWarningEnabled,
boolean isErrorEnabled)
Initializes a new instance of the FileLogger class with file path and logs levels configuration.
|
| Modifier and Type | Method and Description |
|---|---|
void |
debug(String message,
Object... arguments)
Writes a debug message to the file.
|
void |
debug(Throwable throwable,
String message,
Object... arguments)
Writes a debug message to the file.
|
void |
error(String message,
Object... arguments)
Writes an error message to the file.
|
void |
error(Throwable throwable,
String message,
Object... arguments)
Writes an error message to the file.
|
boolean |
isDebugEnabled()
Checks whether debug logging enabled.
|
boolean |
isErrorEnabled()
Checks whether error logging enabled.
|
boolean |
isTraceEnabled()
Checks whether trace logging enabled.
|
boolean |
isWarningEnabled()
Checks whether warning logging enabled.
|
void |
trace(String message,
Object... arguments)
Writes a trace message to the file.
|
void |
trace(Throwable throwable,
String message,
Object... arguments)
Writes a trace message to the file.
|
void |
warning(String message,
Object... arguments)
Writes a warning message to the file.
|
void |
warning(Throwable throwable,
String message,
Object... arguments)
Writes a warning message to the file.
|
public static final String EXCEPTION
public static final String MESSAGE
public FileLogger(String filePath)
Initializes a new instance of the FileLogger class with file path.
filePath - The path to the file that will be used to write logspublic FileLogger(String filePath, boolean isTraceEnabled, boolean isDebugEnabled, boolean isWarningEnabled, boolean isErrorEnabled)
Initializes a new instance of the FileLogger class with file path and logs levels configuration.
filePath - The path to the file that will be used to write logsisTraceEnabled - True to enable trace logging, false otherwiseisDebugEnabled - True to enable debug logging, false otherwiseisWarningEnabled - True to enable warning logging, false otherwiseisErrorEnabled - True to enable error logging, false otherwisepublic void debug(String message, Object... arguments)
Debug log messages provide information about different processes in application flow. The message can contain one or few {} which will be replaced by corresponding arguments.
debug in interface com.groupdocs.foundation.logging.ILoggermessage - The message.arguments - The arguments, replaces {} in message in order of passing, null will be written as 'null'IllegalArgumentException - if message is nullpublic void debug(Throwable throwable, String message, Object... arguments)
Debug log messages provide information about different processes in application flow. The message can contain one or few {} which will be replaced by corresponding arguments.
debug in interface com.groupdocs.foundation.logging.ILoggerthrowable - The throwable object that will be used to get the stacktracemessage - The message.arguments - The arguments, replaces {} in message in order of passing, null will be written as 'null'IllegalArgumentException - if throwable is nullIllegalArgumentException - if message is nullpublic void error(String message, Object... arguments)
Error log messages provide information about unrecoverable events in application flow. The message can contain one or few {} which will be replaced by corresponding arguments.
error in interface com.groupdocs.foundation.logging.ILoggermessage - The message.arguments - The arguments, replaces {} in message in order of passing, null will be written as 'null'IllegalArgumentException - if message is nullpublic void error(Throwable throwable, String message, Object... arguments)
Error log messages provide information about unrecoverable events in application flow. The message can contain one or few {} which will be replaced by corresponding arguments.
error in interface com.groupdocs.foundation.logging.ILoggerthrowable - The throwable object that will be used to get the stacktracemessage - The message.arguments - The arguments, replaces {} in message in order of passing, null will be written as 'null'IllegalArgumentException - if throwable is nullIllegalArgumentException - if message is nullpublic boolean isDebugEnabled()
isDebugEnabled in interface com.groupdocs.foundation.logging.ILoggerpublic boolean isErrorEnabled()
isErrorEnabled in interface com.groupdocs.foundation.logging.ILoggerpublic boolean isTraceEnabled()
isTraceEnabled in interface com.groupdocs.foundation.logging.ILoggerpublic boolean isWarningEnabled()
isWarningEnabled in interface com.groupdocs.foundation.logging.ILoggerpublic void trace(String message, Object... arguments)
Trace log messages provide maximum detailed information about application flow. The message can contain one or few {} which will be replaced by corresponding arguments.
trace in interface com.groupdocs.foundation.logging.ILoggermessage - The message.arguments - The arguments, replaces {} in message in order of passing, null will be written as 'null'IllegalArgumentException - if message is nullpublic void trace(Throwable throwable, String message, Object... arguments)
Trace log messages provide maximum detailed information about application flow. The message can contain one or few {} which will be replaced by corresponding arguments.
trace in interface com.groupdocs.foundation.logging.ILoggerthrowable - The throwable object that will be used to get the stacktracemessage - The message.arguments - The arguments, replaces {} in message in order of passing, null will be written as 'null'IllegalArgumentException - if throwable is nullIllegalArgumentException - if message is nullpublic void warning(String message, Object... arguments)
Warning log messages provide information about unexpected and recoverable events in application flow. The message can contain one or few {} which will be replaced by corresponding arguments.
warning in interface com.groupdocs.foundation.logging.ILoggermessage - The message.arguments - The arguments, replaces {} in message in order of passing, null will be written as 'null'IllegalArgumentException - if message is nullpublic void warning(Throwable throwable, String message, Object... arguments)
Warning log messages provide information about unexpected and recoverable events in application flow. The message can contain one or few {} which will be replaced by corresponding arguments.
warning in interface com.groupdocs.foundation.logging.ILoggerthrowable - The throwable object that will be used to get the stacktracemessage - The message.arguments - The arguments, replaces {} in message in order of passing, null will be written as 'null'IllegalArgumentException - if throwable is nullIllegalArgumentException - if message is nullCopyright © 2024. All rights reserved.