I’m using Spring with 3rd party product API. This product is using its own class for logging
it looks something like this:
import x.y.z.PluginLogger;
public class MyLogger extends PluginLogger{
public MyLogger(){
super("myLogger-log4j-conf.xml");
super.init();
}
}
now I’m initiating this logger in my code:
public static Logger logger = new MyLogger();
Now my question is simple I can initate this class file in Spring Application Context.
<bean id="logger" class="z.y.x.Logger" parent="pluginLogger">
<bean id="pluginLogger" class="x.y.z.ParentLogger">
How can I tell Spring to use logger bean as its default logger? In other words I would like to use this bean as default logger for Spring framework and for my code I writing.?
Hope I maid myself clear.
Spring uses commons-logging.
You can create an integration between commons-logging and your logger.
See this guide