Top Description Constructors Methods
org.springframework.core.log

public final Class LogDelegateFactory

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Collections, .List, org.apache.commons.logging.Log, .LogFactory

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.

Authors
Rossen Stoyanchev, Juergen Hoeller
Since
5.1
See Also
org.apache.commons.logging.LogFactory

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Log

Returns:

the resulting composite logger for the related categories
getCompositeLog
(Log
primary logger to try first
primaryLogger
,
Log
secondary logger
secondaryLogger
,
Log...
optional vararg of further fallback loggers
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.

public static Log

Returns:

a Log with the category "_" + fully-qualified class name
getHiddenLog
(Class<?>
the class for which to create a logger
clazz
)

Create a "hidden" logger with a category name prefixed with "_", thus precluding it from being enabled together with other log categories from the same package.

public static Log

Returns:

a Log with the category "_" + category
getHiddenLog
(String
the log category to use
category
)

Create a "hidden" logger with a category name prefixed with "_", thus precluding it from being enabled together with other log categories from the same package.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

LogDelegateFactoryback to summary
private LogDelegateFactory()

Method Detail

getCompositeLogback to summary
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.

Parameters
primaryLogger:Log

primary logger to try first

secondaryLogger:Log

secondary logger

tertiaryLoggers:Log[]

optional vararg of further fallback loggers

Returns:Log

the resulting composite logger for the related categories

getHiddenLogback to summary
public static Log getHiddenLog(Class<?> clazz)

Create a "hidden" logger with a category name prefixed with "_", thus precluding it from being enabled together with other log categories from the same package. This is useful for specialized output that is either too verbose or otherwise optional or unnecessary to see all the time.

Parameters
clazz:Class<?>

the class for which to create a logger

Returns:Log

a Log with the category "_" + fully-qualified class name

getHiddenLogback to summary
public static Log getHiddenLog(String category)

Create a "hidden" logger with a category name prefixed with "_", thus precluding it from being enabled together with other log categories from the same package. This is useful for specialized output that is either too verbose or otherwise optional or unnecessary to see all the time.

Parameters
category:String

the log category to use

Returns:Log

a Log with the category "_" + category

Since
5.3.5