|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springbyexample.util.log.LoggerBeanPostProcessor
public class LoggerBeanPostProcessor
Injects loggers into new bean instances based on reflection.
Default logger factories configured are SLF4J, Apache Commons, Log4J, and JDK 1.4 Logging.
| Field Summary | |
|---|---|
protected Map<String,String> |
hLoggerFactories
|
protected String |
methodName
|
| Fields inherited from interface org.springframework.core.Ordered |
|---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
| Constructor Summary | |
|---|---|
LoggerBeanPostProcessor()
Constructor |
|
| Method Summary | |
|---|---|
protected Object |
getLogger(String loggerName,
String loggerType)
Gets logger based on the logger name and type of logger (class name, ex: 'org.slf4j.Logger'). |
int |
getOrder()
|
void |
injectMethod(Object bean,
Method method)
Processes a property descriptor to inject a logger. |
Object |
postProcessAfterInitialization(Object bean,
String beanName)
This method is used to execute after a bean's initialization callback. |
Object |
postProcessBeforeInitialization(Object bean,
String beanName)
|
protected void |
processLogger(Object bean,
String methodName)
Instantiates bean specific loggers and sets them. |
void |
setLoggerFactoryMap(Map<String,String> hLoggerFactories)
Set logger factory Map. |
void |
setMethodName(String methodName)
Sets target method name to set logger. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Map<String,String> hLoggerFactories
protected String methodName
| Constructor Detail |
|---|
public LoggerBeanPostProcessor()
| Method Detail |
|---|
public void setMethodName(String methodName)
public void setLoggerFactoryMap(Map<String,String> hLoggerFactories)
Map.
public Object postProcessBeforeInitialization(Object bean,
String beanName)
throws BeansException
postProcessBeforeInitialization in interface BeanPostProcessorBeansException
public Object postProcessAfterInitialization(Object bean,
String beanName)
throws BeansException
postProcessAfterInitialization in interface BeanPostProcessorBeansExceptionBeanPostProcessor.postProcessAfterInitialization(java.lang.Object, java.lang.String)public int getOrder()
getOrder in interface Ordered
protected void processLogger(Object bean,
String methodName)
public void injectMethod(Object bean,
Method method)
protected Object getLogger(String loggerName,
String loggerType)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||