for one of my applications, I have a problem with log4j and appenders for spring 3. The exact error warning message is "log4j: WARN. There are no log subscriptions (org.springframework.test.context.support.DependencyInjectionTestExecutionListener). log4j: WARN Please , initialize the log4j system correctly. ".
I read spring configuration information with log4j, but I have no success to overcome this problem. Working with log4j works, but with this WARN message.
This is my pom configuration for log4j and spring - this is a rather long configuration.
<dependency> <groupId>org.slf4j</groupId> <artifactId>com.springsource.slf4j.api</artifactId> <version>${slf4j.version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>com.springsource.slf4j.org.apache.commons.logging</artifactId> <version>${slf4j.version}</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>com.springsource.slf4j.log4j</artifactId> <version>${slf4j.version}</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>${slf4j.version}</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl-over-slf4j</artifactId> <version>${slf4j.version}</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.apache.log4j</groupId> <artifactId>com.springsource.org.apache.log4j</artifactId> <version>1.2.15</version> <scope>runtime</scope> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.15</version> <exclusions> <exclusion> <groupId>javax.mail</groupId> <artifactId>mail</artifactId> </exclusion> <exclusion> <groupId>javax.jms</groupId> <artifactId>jms</artifactId> </exclusion> <exclusion> <groupId>com.sun.jdmk</groupId> <artifactId>jmxtools</artifactId> </exclusion> <exclusion> <groupId>com.sun.jmx</groupId> <artifactId>jmxri</artifactId> </exclusion> </exclusions> <scope>runtime</scope> </dependency>
Plus, I have one more logging related exception - the exception for maintaining public records for spring -core and spring -context.
This is the web.xml configuration:
<context-param> <param-name>log4jConfigLocation</param-name> <param-value>classpath:META-INF/properties/log4j.properties</param-value> </context-param> <listener> <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> </listener>
This is the configuration of log4j.properties:
log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.rootLogger=DEBUG, stdout, R log4j.appender.R.File=application.log log4j.appender.R.MaxFileSize=700KB log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.MaxBackupIndex=1 log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.logger.mongo=DEBUG,console
I am looking for an additional information source where I can find a way to fix this.
source share