我需要从我的 hadoop mapreduce 作业中打印跟踪和调试消息,同时将 hadoop 系统消息保持在默认级别(默认为 INFO)。
我尝试了以下方法:
在 Job 方法中添加了 logger 消息:
package org.example.mapreducejob
public void reduce(Text extId, Iterable<MyData>> myDataItems, Context context)
throws IOException, InterruptedException {
log.debug("reduce(): i want this message to be printed in the userlogs");
log.info("reduce(): Info message");
...
}
然后在 $HADOOP_HOME/conf/log4.properties 我添加了这一行:
log4j.logger.com.terapeak.etl=DEBUG
并重新启动节点
但是,用户日志中只出现“信息消息”。我应该在哪里更改记录器配置以启用用户作业的调试消息?