Package es.gob.afirma.logger
Class Logger
- java.lang.Object
-
- es.gob.afirma.logger.Logger
-
public class Logger extends java.lang.ObjectClass that encapsulates the logging methods.
Project:Library for the integration with the services of @Firma, eVisor and TS@.
- Version:
- 1.0, 05/04/2022.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddebug(java.lang.Object message)Method that encapsulates the call to the info logger method.voiddebug(java.lang.Object message, java.lang.Throwable t)Method that encapsulates the call to the info logger method, including the stack trace.voiderror(java.lang.Object message)Method that encapsulates the call to the info logger method.voiderror(java.lang.Object message, java.lang.Throwable t)Method that encapsulates the call to the info logger method, including the stack trace.static LoggergetLogger(java.lang.Class<?> clazz)Method that encapsulates the call to the logger retrieval according to the chosen logger system implementation.static LoggergetLogger(java.lang.String name)Method that encapsulates the call to the logger retrieval according to the chosen logger system implementation.voidinfo(java.lang.Object message)Method that encapsulates the call to the info logger method.voidinfo(java.lang.Object message, java.lang.Throwable t)Method that encapsulates the call to the info logger method, including the stack trace.booleanisDebugEnabled()Checks whether this Logger is enabled for the DEBUG Level.voidwarn(java.lang.Object message)Method that encapsulates the call to the info logger method.voidwarn(java.lang.Object message, java.lang.Throwable t)Method that encapsulates the call to the info logger method, including the stack trace.
-
-
-
Constructor Detail
-
Logger
public Logger(java.lang.String name)
Constructor for instancing the configured Logger class using an appender name- Parameters:
name- String that represents an appender name configured.
-
Logger
public Logger(java.lang.Class<?> clazz)
Constructor for instancing the configured Logger class using a class object.- Parameters:
clazz- Class object of the Logger.
-
-
Method Detail
-
getLogger
public static Logger getLogger(java.lang.String name)
Method that encapsulates the call to the logger retrieval according to the chosen logger system implementation.- Parameters:
name- The name of the configured logger.- Returns:
- a new
Logger
-
getLogger
public static Logger getLogger(java.lang.Class<?> clazz)
Method that encapsulates the call to the logger retrieval according to the chosen logger system implementation.- Parameters:
clazz- The .class of the class whose logger we want to obtain.- Returns:
- a new
Logger
-
info
public void info(java.lang.Object message)
Method that encapsulates the call to the info logger method.- Parameters:
message- String that represents the message to log with the INFO level.
-
info
public void info(java.lang.Object message, java.lang.Throwable t)Method that encapsulates the call to the info logger method, including the stack trace.- Parameters:
message- String that represents the message to log with the INFO level.t- the exception to log, including its stack trace.
-
debug
public void debug(java.lang.Object message)
Method that encapsulates the call to the info logger method.- Parameters:
message- String that represents the message to log with the DEBUG level.
-
debug
public void debug(java.lang.Object message, java.lang.Throwable t)Method that encapsulates the call to the info logger method, including the stack trace.- Parameters:
message- String that represents the message to log with the DEBUG level.t- the exception to log, including its stack trace.
-
warn
public void warn(java.lang.Object message)
Method that encapsulates the call to the info logger method.- Parameters:
message- String that represents the message to log with the WARN level.
-
warn
public void warn(java.lang.Object message, java.lang.Throwable t)Method that encapsulates the call to the info logger method, including the stack trace.- Parameters:
message- String that represents the message to log with the WARN level.t- the exception to log, including its stack trace.
-
error
public void error(java.lang.Object message)
Method that encapsulates the call to the info logger method.- Parameters:
message- String that represents the message to log with the ERROR level.
-
error
public void error(java.lang.Object message, java.lang.Throwable t)Method that encapsulates the call to the info logger method, including the stack trace.- Parameters:
message- String that represents the message to log with the ERROR level.t- the exception to log, including its stack trace.
-
isDebugEnabled
public boolean isDebugEnabled()
Checks whether this Logger is enabled for the DEBUG Level.- Returns:
trueif debug mode is enabled,falseotherwise.
-
-