|
SLF4JExtension
SLF4J Logging Extension
Extension IntroductionThis is a simple extension to Morphia to redirect logging to SFL4J. UsingAdd this at the start of your application. It is done once, statically. MorphiaLoggerFactory.registerLogger(SLF4JLoggerImplFactory.class); DependenciesManualMaven
<dependency>
<groupId>com.google.code.morphia</groupId>
<artifactId>morphia-logging-slf4j</artifactId>
<version>0.99</version>
</dependency>
| |
► Sign in to add a comment
SLF4JLoggerImplFactory is actually com.google.code.morphia.logging.slf4j.SLF4JLogrImplFactory
what does start of application mean? where? 2011-5-11 0:00:05 com.google.code.morphia.mapping.Mapper validate 警告: The type(s) for the query/update may be inconsistent; using an instance of type 'org.bson.types.ObjectId?' for the field 'com.joyful.canyin.shared.entity.Restaurant.id' which is declared as 'java.lang.String'
I don't want to show this log ? what can I do for this? I am waiting for your help... thank youhow to use morphia logging?
OK, figure out: 1. download morphia-logging-slf4j.jar and drop to your classpath 2. in your spring xml:
I cant get it to work with jboss as 7 and resteasy i put the static method static {
}and i am having the same error... java.lang.ClassNotFoundException?: org.slf4j.LoggerFactory? from "deployment.Service.war:main" from Service Module Loader?
What i am doing wrong i have the jars in my lib folder morphia-1.00-SNAPSHOT.jar morphia-validation-0.99.jar morphia-logging-slf4j-0.99.jar
When using SpringConfig?.java use:
In order to get 0.99 working with spring, I had to use the following configuration:
I believe the documentation in the above wiki entry will work given the fixes in the current trunk code.
Why does SLF4J logging become an "extension"? It should simply use the SLF4J API... It's a reasonable dependency.