Initializes a new instance of the FileLogger class with file path and logs levels configuration.
Parameters:
Parameter
Type
Description
filePath
java.lang.String
The path to the file that will be used to write logs
isTraceEnabled
boolean
True to enable trace logging, false otherwise
isDebugEnabled
boolean
True to enable debug logging, false otherwise
isWarningEnabled
boolean
True to enable warning logging, false otherwise
isErrorEnabled
boolean
True to enable error logging, false otherwise
MESSAGE
public static final String MESSAGE
EXCEPTION
public static final String EXCEPTION
trace(String message, Object[] arguments)
public void trace(String message, Object[] arguments)
Writes a trace message to the file.
Trace log messages provide maximum detailed information about application flow.
The message can contain one or few {} which will be replaced by corresponding arguments.
Parameters:
Parameter
Type
Description
message
java.lang.String
The message.
arguments
java.lang.Object[]
The arguments, replaces {} in message in order of passing, null will be written as ’null'
public void trace(Throwable throwable, String message, Object[] arguments)
Writes a trace message to the file.
Trace log messages provide maximum detailed information about application flow.
The message can contain one or few {} which will be replaced by corresponding arguments.
Parameters:
Parameter
Type
Description
throwable
java.lang.Throwable
The throwable object that will be used to get the stacktrace
message
java.lang.String
The message.
arguments
java.lang.Object[]
The arguments, replaces {} in message in order of passing, null will be written as ’null'
isTraceEnabled()
public boolean isTraceEnabled()
Checks whether trace logging enabled.
Returns:
boolean - true if enabled, otherwise false
debug(String message, Object[] arguments)
public void debug(String message, Object[] arguments)
Writes a debug message to the file.
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.
Parameters:
Parameter
Type
Description
message
java.lang.String
The message.
arguments
java.lang.Object[]
The arguments, replaces {} in message in order of passing, null will be written as ’null'
public void debug(Throwable throwable, String message, Object[] arguments)
Writes a debug message to the file.
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.
Parameters:
Parameter
Type
Description
throwable
java.lang.Throwable
The throwable object that will be used to get the stacktrace
message
java.lang.String
The message.
arguments
java.lang.Object[]
The arguments, replaces {} in message in order of passing, null will be written as ’null'
isDebugEnabled()
public boolean isDebugEnabled()
Checks whether debug logging enabled.
Returns:
boolean - true if enabled, otherwise false
warning(String message, Object[] arguments)
public void warning(String message, Object[] arguments)
Writes a warning message to the file.
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.
Parameters:
Parameter
Type
Description
message
java.lang.String
The message.
arguments
java.lang.Object[]
The arguments, replaces {} in message in order of passing, null will be written as ’null'
public void warning(Throwable throwable, String message, Object[] arguments)
Writes a warning message to the file.
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.
Parameters:
Parameter
Type
Description
throwable
java.lang.Throwable
The throwable object that will be used to get the stacktrace
message
java.lang.String
The message.
arguments
java.lang.Object[]
The arguments, replaces {} in message in order of passing, null will be written as ’null'
isWarningEnabled()
public boolean isWarningEnabled()
Checks whether warning logging enabled.
Returns:
boolean - true if enabled, otherwise false
error(String message, Object[] arguments)
public void error(String message, Object[] arguments)
Writes an error message to the file.
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.
Parameters:
Parameter
Type
Description
message
java.lang.String
The message.
arguments
java.lang.Object[]
The arguments, replaces {} in message in order of passing, null will be written as ’null'
public void error(Throwable throwable, String message, Object[] arguments)
Writes an error message to the file.
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.
Parameters:
Parameter
Type
Description
throwable
java.lang.Throwable
The throwable object that will be used to get the stacktrace
message
java.lang.String
The message.
arguments
java.lang.Object[]
The arguments, replaces {} in message in order of passing, null will be written as ’null'
isErrorEnabled()
public boolean isErrorEnabled()
Checks whether error logging enabled.
Returns:
boolean - true if enabled, otherwise false
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.