Class RestFBLogger

  • Direct Known Subclasses:
    JulLogger, SLF4JLogger

    public abstract class RestFBLogger
    extends Object
    Abstract class that is the parent of all our logger implementations.

    Normally RestFB uses java.util.logging for logging messages. But as soon as slf4j is found on the class path RestFB switches to this logger. With the slf4j facade more logger implementations are supported and the quasi standard for java logging is used.

    In the rare case you have to switch to java.util.logging although slf4j is present on the class path we provide a system property to force java.util.logging to be used.

    The system property is called com.restfb.forceJUL and can be set to true if jul should be forced.

    • Method Detail

      • getLoggerInstance

        public static RestFBLogger getLoggerInstance​(String logCategory)
        returns the instance of the logger that belongs to the category.
        Parameters:
        logCategory - the category of the logger
        Returns:
        a instance of the logger
      • trace

        public abstract void trace​(String msg,
                                   Object... args)
        Log a message at the TRACE level according to the specified format and arguments.
        Parameters:
        msg - the log message
        args - optional arguments, the last argument may be an exception
      • debug

        public abstract void debug​(String msg,
                                   Object... args)
        Log a message at the DEBUG level according to the specified format and arguments.
        Parameters:
        msg - the log message
        args - optional arguments, the last argument may be an exception
      • info

        public abstract void info​(String msg,
                                  Object... args)
        Log a message at the INFO level according to the specified format and arguments.
        Parameters:
        msg - the log message
        args - optional arguments, the last argument may be an exception
      • warn

        public abstract void warn​(String msg,
                                  Object... args)
        Log a message at the WARN level according to the specified format and arguments.
        Parameters:
        msg - the log message
        args - optional arguments, the last argument may be an exception
      • error

        public abstract void error​(String msg,
                                   Object... args)
        Log a message at the ERROR level according to the specified format and arguments.
        Parameters:
        msg - the log message
        args - optional arguments, the last argument may be an exception
      • fatal

        public abstract void fatal​(String msg,
                                   Object... args)
        Log a message at the FATAL level according to the specified format and arguments.
        Parameters:
        msg - the log message
        args - optional arguments, the last argument may be an exception
      • isDebugEnabled

        public abstract boolean isDebugEnabled()
        Is the logger instance enabled for the DEBUG level?
        Returns:
        true if it is enabled, false otherwise
      • isInfoEnabled

        public abstract boolean isInfoEnabled()
        Is the logger instance enabled for the INFO level?
        Returns:
        true if it is enabled, false otherwise
      • isTraceEnabled

        public abstract boolean isTraceEnabled()
        Is the logger instance enabled for the TRACE level?
        Returns:
        true if it is enabled, false otherwise