类 LogDelegateFactory


  • public final class LogDelegateFactory
    extends Object
    Factory for common Log delegates with Spring's logging conventions.

    Mainly for internal use within the framework with Apache Commons Logging, typically in the form of the spring-jcl bridge but also compatible with other Commons Logging bridges.

    从以下版本开始:
    5.1
    作者:
    Rossen Stoyanchev, Juergen Hoeller
    另请参阅:
    LogFactory
    • 方法详细资料

      • getCompositeLog

        public static Log getCompositeLog​(Log primaryLogger,
                                          Log secondaryLogger,
                                          Log... tertiaryLoggers)
        Create a composite logger that delegates to a primary or falls back on a secondary logger if logging for the primary logger is not enabled.

        This may be used for fallback logging from lower-level packages that logically should log together with some higher-level package but the two don't happen to share a suitable parent package (e.g. logging for the web and lower-level http and codec packages). For such cases the primary (class-based) logger can be wrapped with a shared fallback logger.

        参数:
        primaryLogger - primary logger to try first
        secondaryLogger - secondary logger
        tertiaryLoggers - optional vararg of further fallback loggers
        返回:
        the resulting composite logger for the related categories
      • getHiddenLog

        public static Log getHiddenLog​(Class<?> clazz)
        Create a "hidden" logger whose name is intentionally prefixed with "_" because its output is either too verbose or otherwise deemed as optional or unnecessary to see at any log level by default under the normal package based log hierarchy.
        参数:
        clazz - the class for which to create a logger
        返回:
        a logger for the hidden category ("_" + fully-qualified class name)