我想在 Flink 中输出日志,我已经创建了如下所述的记录器代码
我已经导入了 LoggerFactory
import org.slf4j.LoggerFactory;
CEPMonitoring 类包含代码如下
final static org.slf4j.Logger logger = LoggerFactory.getLogger(CEPMonitoring.class);
public static void main(String[] args) throws Exception {
logger.info("execution began \n ");
}
但是,这并没有打印任何东西。另外,我没有https://ci.apache.org/projects/flink/flink-docs-release-0.7/internal_logging.htmllogback.xml
中提到的文件
PS - 我在使用时遇到错误
final static Logger logger = LoggerFactory.getLogger(CEPMonitoring.class);
这最终导致我写
final static org.slf4j.Logger logger = LoggerFactory.getLogger(CEPMonitoring.class);
它给出了一个错误,然后我必须
最重要的是,我在运行程序时收到以下警告
log4j:WARN No appenders could be found for logger (org.stsffap.cep.monitoring.CEPMonitoring).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
我很困惑该怎么办?