Class LoggerFacade

  • Direct Known Subclasses:
    Slf4jLoggerFacade

    public class LoggerFacade
    extends java.lang.Object
    Logger facade to the underlying logging framework used by the Restlet Framework. By default, it relies on the JULI mechanism built in Java SE. You can provide an alternate implementation by extending this class and overriding the methods.
    • Constructor Summary

      Constructors 
      Constructor Description
      LoggerFacade()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.logging.Logger getAnonymousLogger()
      Returns an anonymous logger.
      java.util.logging.Logger getLogger​(java.lang.Class<?> clazz)
      Returns a logger based on the class name of the given object.
      java.util.logging.Logger getLogger​(java.lang.Class<?> clazz, java.lang.String defaultLoggerName)
      Returns a logger based on the class name of the given object.
      java.util.logging.Logger getLogger​(java.lang.Object object, java.lang.String defaultLoggerName)
      Returns a logger based on the class name of the given object.
      java.util.logging.Logger getLogger​(java.lang.String loggerName)
      Returns a logger based on the given logger name.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LoggerFacade

        public LoggerFacade()
    • Method Detail

      • getAnonymousLogger

        public java.util.logging.Logger getAnonymousLogger()
        Returns an anonymous logger. By default it calls Logger.getAnonymousLogger(). This method should be overridden by subclasses.
        Returns:
        The logger.
      • getLogger

        public final java.util.logging.Logger getLogger​(java.lang.Class<?> clazz)
        Returns a logger based on the class name of the given object. By default, it calls getLogger(Class, String) with a null default logger name.
        Parameters:
        clazz - The parent class.
        Returns:
        The logger.
      • getLogger

        public final java.util.logging.Logger getLogger​(java.lang.Class<?> clazz,
                                                        java.lang.String defaultLoggerName)
        Returns a logger based on the class name of the given object.
        Parameters:
        clazz - The parent class.
        defaultLoggerName - The default logger name to use if no one can be inferred from the class.
        Returns:
        The logger.
      • getLogger

        public final java.util.logging.Logger getLogger​(java.lang.Object object,
                                                        java.lang.String defaultLoggerName)
        Returns a logger based on the class name of the given object. By default, it calls getLogger(Class, String) with the object's class as a first parameter.
        Parameters:
        object - The parent object.
        defaultLoggerName - The default logger name to use if no one can be inferred from the object class.
        Returns:
        The logger.
      • getLogger

        public java.util.logging.Logger getLogger​(java.lang.String loggerName)
        Returns a logger based on the given logger name. By default, it calls Logger.getLogger(String). This method should be overridden by subclasses.
        Parameters:
        loggerName - The logger name.
        Returns:
        The logger.