Class FedletLogger

  • All Implemented Interfaces:
    Logger

    public class FedletLogger
    extends Object
    implements Logger
    This class is an implementation of the Open Federation Logger interface for Fedlet deployment. The implementation uses JDK logger.
    • Field Detail

      • accessLogger

        protected Logger accessLogger
      • errorLogger

        protected Logger errorLogger
    • Constructor Detail

      • FedletLogger

        public FedletLogger()
    • Method Detail

      • init

        public void init​(String componentName)
                  throws LogException
        Initializes the logging for the component.
        Specified by:
        init in interface Logger
        Parameters:
        componentName - the component name.
        Throws:
        LogException - if there is an error during initialization.
      • access

        public void access​(Level level,
                           String messageId,
                           String[] data,
                           Object session)
                    throws LogException
        Logs message to the access logs.
        Specified by:
        access in interface Logger
        Parameters:
        level - the log level , these are based on those defined in java.util.logging.Level, the values for level can be any one of the following :
        • SEVERE (highest value)
        • WARNING
        • INFO
        • CONFIG
        • FINE
        • FINER
        • FINEST (lowest value)
        messageId - the message or a message identifier.
        data - string array of dynamic data to be replaced in the message.
        session - the User's session object
        Throws:
        LogException - if there is an error.
      • access

        public void access​(Level level,
                           String messageId,
                           String[] data,
                           Object session,
                           Map props)
                    throws LogException
        Writes access to a component into a log.
        Specified by:
        access in interface Logger
        Parameters:
        level - indicating log level
        messageId - Message id
        data - string array of dynamic data only known during run time
        session - Session object (it could be null)
        props - representing log record columns
        Throws:
        LogException - if there is an error.
      • error

        public void error​(Level level,
                          String messageId,
                          String[] data,
                          Object session)
                   throws LogException
        Logs error messages to the error logs.
        Specified by:
        error in interface Logger
        Parameters:
        level - the log level , these are based on those defined in java.util.logging.Level, the values for level can be any one of the following :
        • SEVERE (highest value)
        • WARNING
        • INFO
        • CONFIG
        • FINE
        • FINER
        • FINEST (lowest value)
        messageId - the message or a message identifier.
        data - string array of dynamic data to be replaced in the message.
        session - the User's Session object.
        Throws:
        LogException - if there is an error.
      • error

        public void error​(Level level,
                          String messageId,
                          String[] data,
                          Object session,
                          Map props)
                   throws LogException
        Writes error occurred in a component into a log.
        Specified by:
        error in interface Logger
        Parameters:
        level - indicating log level
        messageId - Message id
        data - string array of dynamic data only known during run time
        session - Session object (it could be null)
        props - log record columns
        Throws:
        LogException - if there is an error.
      • isLogEnabled

        public boolean isLogEnabled()
        Returns true if logging is enabled.
        Specified by:
        isLogEnabled in interface Logger
        Returns:
        true if logging is enabled.
      • isAccessLoggable

        public boolean isAccessLoggable​(Level level)
        Checks if an access message of the given level would actually be logged by this logger. This check is based on the Logger's effective level.
        Specified by:
        isAccessLoggable in interface Logger
        Parameters:
        level - a message logging level defined in java.util.logging.Level.
        Returns:
        true if the given message level is currently being logged.
      • isErrorLoggable

        public boolean isErrorLoggable​(Level level)
        Checks if an error message of the given level would actually be logged by this logger. This check is based on the Logger's effective level.
        Specified by:
        isErrorLoggable in interface Logger
        Parameters:
        level - a message logging level defined in java.util.logging.Level.
        Returns:
        true if the given message level is currently being logged.