Class Logger


  • public class Logger
    extends java.lang.Object

    Class that encapsulates the logging methods.

    Project:

    Library for the integration with the services of @Firma, eVisor and TS@.

    Version:
    1.0, 05/04/2022.
    • Constructor Summary

      Constructors 
      Constructor Description
      Logger​(java.lang.Class<?> clazz)
      Constructor for instancing the configured Logger class using a class object.
      Logger​(java.lang.String name)
      Constructor for instancing the configured Logger class using an appender name
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void debug​(java.lang.Object message)
      Method that encapsulates the call to the info logger method.
      void debug​(java.lang.Object message, java.lang.Throwable t)
      Method that encapsulates the call to the info logger method, including the stack trace.
      void error​(java.lang.Object message)
      Method that encapsulates the call to the info logger method.
      void error​(java.lang.Object message, java.lang.Throwable t)
      Method that encapsulates the call to the info logger method, including the stack trace.
      static Logger getLogger​(java.lang.Class<?> clazz)
      Method that encapsulates the call to the logger retrieval according to the chosen logger system implementation.
      static Logger getLogger​(java.lang.String name)
      Method that encapsulates the call to the logger retrieval according to the chosen logger system implementation.
      void info​(java.lang.Object message)
      Method that encapsulates the call to the info logger method.
      void info​(java.lang.Object message, java.lang.Throwable t)
      Method that encapsulates the call to the info logger method, including the stack trace.
      boolean isDebugEnabled()
      Checks whether this Logger is enabled for the DEBUG Level.
      void warn​(java.lang.Object message)
      Method that encapsulates the call to the info logger method.
      void warn​(java.lang.Object message, java.lang.Throwable t)
      Method that encapsulates the call to the info logger method, including the stack trace.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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:
        true if debug mode is enabled, false otherwise.