java – Morphia在春天登录log4j
作者:互联网
我想用log4j在Sfl4j上记录Morphia.来自Morphia的文档:
Add this at the start of your
application. It is done once,
statically.
MorphiaLoggerFactory.registerLogger(SLF4JLoggerImplFactory.class);
我不能为上面的语句创建必要的bean来完成这项工作.
解决方法:
尽管文档声称没有,但该类实际上称为SLF4JLogrImplFactory(Logr,而不是Logger):
import com.google.code.morphia.logging.slf4j.*;
MorphiaLoggerFactory.registerLogger(SLF4JLogrImplFactory.class);
标签:java,spring,mongodb,javabeans,morphia 来源: https://codeday.me/bug/20190827/1737086.html