Class LocalizedLoggerFactory


  • public final class LocalizedLoggerFactory
    extends Object
    A factory of LocalizedLogger instances which obtains a SLF4J Logger by calling the appropriate LoggerFactory method and wrapping it in an instance of LocalizedLogger.
    • Method Detail

      • getInstance

        public static LocalizedLoggerFactory getInstance()
        Returns a localized logger factory which will create localized loggers for the default locale.
        Returns:
        The localized logger factory.
      • getInstance

        public static LocalizedLoggerFactory getInstance​(Locale locale)
        Returns a localized logger factory which will create localized loggers for the provided locale.
        Parameters:
        locale - The locale to which loggers created by the factory will localize all log messages.
        Returns:
        The localized logger factory.
      • getLocalizedLogger

        public LocalizedLogger getLocalizedLogger​(Class<?> clazz)
        Returns a localized logger which will forward log messages to an SLF4J Logger obtained by calling LoggerFactory.getLogger(Class) .
        Parameters:
        clazz - The name of the wrapped SLF4J Logger.
        Returns:
        The localized logger.
        See Also:
        LoggerFactory.getLogger(Class)
      • getLocalizedLogger

        public LocalizedLogger getLocalizedLogger​(org.slf4j.Logger logger)
        Returns a localized logger which will forward log messages to the provided SLF4J Logger.
        Parameters:
        logger - The wrapped SLF4J Logger.
        Returns:
        The localized logger.
        See Also:
        LoggerFactory.getLogger(String)
      • getLocalizedLogger

        public LocalizedLogger getLocalizedLogger​(String name)
        Returns a localized logger which will forward log messages to an SLF4J Logger obtained by calling LoggerFactory.getLogger(String).
        Parameters:
        name - The name of the wrapped SLF4J Logger.
        Returns:
        The localized logger.
        See Also:
        LoggerFactory.getLogger(String)