【发布时间】:2016-10-01 03:01:55
【问题描述】:
当我按照文档配置将 workerLogLevelOverrides 设置为 {\"com.mycompany.testdataflow.StarterPipeline\":\"TRACE\"} 的 google cloud dataflow eclipse 插件时,我无法看到日志
奇怪的是,错误级别的配置似乎显示了日志,但任何更低的都不会。
有人遇到过这个吗?
这是我用来尝试输出日志的代码段
私有静态最终Logger LOG = LoggerFactory.getLogger(StarterPipeline.class);
public static void main(String[] args) {
Pipeline p = Pipeline.create(PipelineOptionsFactory.fromArgs(args).withValidation().create());
for (String string : args) {
// System.out.println("########## "+string);
LOG.trace("Doing the trace for pipeline ##### Parameter is #### " + string);
LOG.trace("Doing the trace for pipeline ##### Parameter is #### ");
}
LOG.trace("Doing the trace for pipeline");
p.apply(Create.of("Hello", "World")).apply(ParDo.of(new DoFn<String, String>() {
@Override
public void processElement(ProcessContext c) {
LOG.trace("Doing the trace for pipeline");
c.output(c.element().toUpperCase());
}
})).apply(ParDo.of(new DoFn<String, Void>() {
@Override
public void processElement(ProcessContext c) {
LOG.trace("Doing the trace for pipeline");
LOG.info(c.element());
}
}));
这来自数据流示例,除了我添加的日志以查看我是否能够看到任何日志。
【问题讨论】:
-
您使用的是什么 PipelineRunner?你在哪里寻找日志?您在寻找哪种登录方式?你看过关于日志的DebuggingWordCount example 吗?
-
@BenChambers 感谢您的快速回复。我正在使用 BlockingDataflowPipelineRunner ,我正在控制台(eclipse 控制台)上寻找日志,例如 LOG.trace("Doing the trace for pipeline ##### Parameter is #### ");这是我刚刚添加的日志行,用于查看控制台上正在写入的内容。但即使我在日志下查看谷歌云控制台时,我也看不到我正在寻找的日志,事实上在日志级别中没有 TRACE