Package org.forgerock.i18n.slf4j
Class LocalizedLoggerFactory
- java.lang.Object
-
- org.forgerock.i18n.slf4j.LocalizedLoggerFactory
-
public final class LocalizedLoggerFactory extends Object
A factory ofLocalizedLogger
instances which obtains a SLF4JLogger
by calling the appropriateLoggerFactory
method and wrapping it in an instance ofLocalizedLogger
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LocalizedLoggerFactory
getInstance()
Returns a localized logger factory which will create localized loggers for the default locale.static LocalizedLoggerFactory
getInstance(Locale locale)
Returns a localized logger factory which will create localized loggers for the provided locale.LocalizedLogger
getLocalizedLogger(Class<?> clazz)
Returns a localized logger which will forward log messages to an SLF4JLogger
obtained by callingLoggerFactory.getLogger(Class)
.LocalizedLogger
getLocalizedLogger(String name)
Returns a localized logger which will forward log messages to an SLF4JLogger
obtained by callingLoggerFactory.getLogger(String)
.LocalizedLogger
getLocalizedLogger(org.slf4j.Logger logger)
Returns a localized logger which will forward log messages to the provided SLF4JLogger
.
-
-
-
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 SLF4JLogger
obtained by callingLoggerFactory.getLogger(Class)
.- Parameters:
clazz
- The name of the wrapped SLF4JLogger
.- 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 SLF4JLogger
.- Parameters:
logger
- The wrapped SLF4JLogger
.- 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 SLF4JLogger
obtained by callingLoggerFactory.getLogger(String)
.- Parameters:
name
- The name of the wrapped SLF4JLogger
.- Returns:
- The localized logger.
- See Also:
LoggerFactory.getLogger(String)
-
-