我正在使用Spring和第三方产品API。该产品使用自己的类进行日志记录
它看起来像这样:
import x.y.z.PluginLogger;
public class MyLogger extends PluginLogger{
public MyLogger(){
super("myLogger-log4j-conf.xml");
super.init();
}
}
现在我在我的代码中启动了这个记录器:
public static Logger logger = new MyLogger();
现在我的问题很简单,我可以在Spring Application Context中启动这个类文件。
<bean id="logger" class="z.y.x.Logger" parent="pluginLogger">
<bean id="pluginLogger" class="x.y.z.ParentLogger">
如何告诉Spring使用logger bean作为默认记录器?换句话说,我想使用这个bean作为Spring框架的默认记录器和我编写的代码。?
希望我自己清醒。