사용자 로그의 로그 수준, 즉 CDH 5.2.1의 /var/log/hadoop-yarn/userlogs/application_<id>/container_<id>
아래에 나타나는 파일을 변경하려고했습니다. 그러나 무엇을 시도해도 INFO
수준의 로그 만 표시됩니다. 디버깅을 위해 TRACE
레벨 로그를 사용 가능하게하고 싶습니다.Hadoop 2에서 사용자 로그의 로그 수준을 변경하는 방법은 무엇입니까?
것들 지금까지 시도 :
/etc/hadoop/conf/log4j.properties
의 수준을 추적하기 위해 모든 로거를 설정.mapreduce.map.log.level
및mapreduce.reduce.log.level
을mapred-site.xml
으로 설정하십시오.- 제출하기 전에 작업 구성에
mapreduce.map.log.level
및mapreduce.reduce.log.level
을 설정하십시오. - 내 작업 jar 파일에
log4j.properties
을 포함시켜 루트 Log4j 로거를 TRACE로 설정합니다. 그들은 아무것도 휴식하지 않았다,하지만 그들은userlogs
디렉토리에 로그 출력에 영향을주지 않았다 - 이러한 작업의YARN_ROOT_LOGGER=TRACE,console
없음을 지정하는 yarn-env.sh
수정
관련성이있는 /var/log/hadoop-yarn/userlogs/application_<id>/container_<id>/stderr
에 다음과 같은 오류가 표시됩니다.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/lib/zookeeper/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/tmp/hadoop-yarn/nm-local-dir/usercache/tomcat/appcache/application_1419961570089_0001/filecache/10/job.jar/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
log4j:WARN No appenders could be found for logger (org.apache.hadoop.ipc.Server).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
나는의 log4j는 "어떤 구성이"메시지가 루트 로거 지정 작업 jar 파일의 루트에 log4j.properties
파일이 주어진, 일어나지 않을 것입니다 이유를 이해하지 않습니다
log4j.rootLogger=TRACE, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] %m%n
가 내 코드는 의도적으로 SLF4J를 로깅에 사용하지 않으며, 순수하게 Log4j를 사용합니다.
이것은 컨테이너 로그 디렉토리에서 "syslog"파일을 제거 했으므로 약간의 효과가있는 것 같습니다. 그러나 그 모든 일이 일어났습니다. [예제 속성 파일] (https://apache.googlesource.com/hadoop-common/+/2942a5bfbafd67655b0859d339a4e95a0b6d5044/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager)을 사용했습니다. /src/main/resources/container-log4j.properties). 나는 이것이 실제로 무엇을하려고하는지에 대한 단서를 가지고있다. – amoe
'syslog'파일의 로그 수준 만 변경하려는 경우이 매개 변수에 올바른 값을 지정해야할지 모르겠습니다. – amoe