开发者

Morphia logging over log4j in spring

开发者 https://www.devze.com 2023-02-13 22:27 出处:网络
I want to log Morphia over Sfl4j with log4j. From Morphia\'s documentation: Add this at the start of your

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号