我有一个我想要登录的maven&spring应用程序.我很想使用SLF4J.
我想将所有配置文件放入包含log4j.xml的目录{classpath}/config中,然后使用spring bean将init放入.
例如
<bean id="log4jInitialization" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetClass" value="org.springframework.util.Log4jConfigurer"/>
<property name="targetMethod" value="initLogging"/>
<property name="arguments">
<list>
<value>classpath:config/log4j.xml</value>
</list>
</property>
</bean>
Run Code Online (Sandbox Code Playgroud)
但是我收到此警告并且没有记录.
log4j的:警告没有附加目的地可以发现记录器(org.springframework.context.support.ClassPathXmlApplicationContext).log4j:WARN请正确初始化log4j系统.log4j的:WARN见http://logging.apache.org/log4j/1.2/faq.html#noconfig获取更多信息.
我已经google了,找不到一个简单的例子来设置它.有任何想法吗?