SLF4J无法找到绑定(Eclipse Maven项目)-我缺少什么?

时间:2019-05-11 04:25:10

标签: slf4j

我有一个结构如下的Eclipse Maven项目:

enter image description here

log4j.properties的内容是

log4j.rootLogger=INFO, stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender 
log4j.appender.stdout.Target=System.out 
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n

登录代码为

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
...
Logger logger = LoggerFactory.getLogger(MyKafkaProducer.class);
logger.warn("WSTART");

当尝试执行它时,我收到了臭名昭著的消息

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

我想念什么?

0 个答案:

没有答案