I want to log Morphia over Sfl4j with log4j. From Morphia's documentation:
Add this at the start of your application. It is do开发者_StackOverflow中文版ne once, statically. MorphiaLoggerFactory.registerLogger(SLF4JLoggerImplFactory.class);
I can't create necessary beans for above statement to get that work.
Despite the docs claiming otherwise, the class is actually called SLF4JLogrImplFactory (Logr, not Logger):
import com.google.code.morphia.logging.slf4j.*;
MorphiaLoggerFactory.registerLogger(SLF4JLogrImplFactory.class);
This seems like a spring issue. You need to find out how to do some kind of static initialization.
精彩评论