How to change log level of userlogs in Hadoop 2?

amoe

I've been trying to change the log level on userlogs i.e the files that appear under /var/log/hadoop-yarn/userlogs/application_<id>/container_<id> on CDH 5.2.1. However, no matter what I try, only INFO level logs will appear. I want to enable TRACE level logs for debugging.

Things I have tried so far:

  • Setting all loggers to TRACE level in /etc/hadoop/conf/log4j.properties.
  • Setting mapreduce.map.log.level and mapreduce.reduce.log.level in mapred-site.xml.
  • Setting mapreduce.map.log.level and mapreduce.reduce.log.level in the job configuration before submitting it.
  • Including a log4j.properties in my job jar file that sets the root Log4j logger to TRACE.
  • Modifying yarn-env.sh to specify YARN_ROOT_LOGGER=TRACE,console

None of these worked -- they didn't break anything, but they didn't have any effect on the log outputs under the userlogs directory. Modifying yarn-env.sh did cause the ResourceManager and NodeManager logs to enter trace level. Unfortunately these are not useful for my purpose.

I get the following error appearing in /var/log/hadoop-yarn/userlogs/application_<id>/container_<id>/stderr that may be relevant.

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.

I don't understand why the log4j "no configuration" message would happen, given that there is a log4j.properties file at the root of the job jar file that specifies a root logger:

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

My code does not knowingly use SLF4J for logging, it purely uses Log4j.

amoe

The actual answer was to set yarn.app.mapreduce.am.log.level to the level you need, but, crucially, it needs to be set in the Hadoop job configuration at submission time. It cannot be set on the cluster globally. The cluster global will always default to INFO, as it is hardcoded.

Using container-log4j.properties alone will not work as YARN will override the log level value on the command line. See the method addLog4jSystemProperties of org.apache.hadoop.mapreduce.v2.util.MRApps and cross reference with org.apache.hadoop.mapreduce.MRJobConfig.

container-log4j.properties will indeed be honoured, but it can't override the level set by this property.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to change cron log level?

From Dev

How to change the HADOOP log files location

From Dev

How to change python log level for unnamed logger?

From Java

Programmatically change log level in Log4j2

From Dev

Log output too verbose - how to change log level?

From Dev

Log4j2 does not change logging level at runtime

From Dev

how to log only one level with log4j2?

From Dev

How to change the log level in semantic logging at run time?

From Dev

How to Change log level for particular users/threads at runtime

From Dev

how to change the log level to ERROR for systemd-resolved

From Dev

Is necessary to restart hadoop after changing log level?

From Dev

Logback log level change not working

From Dev

How to log FATAL (or any custom log level) with SLF4J and Log4j2

From Dev

Is it possible to change the log level for an application at compile time?

From Dev

Change log level for phantom embedded Cassandra

From Dev

Change log-level via mocking

From Dev

PAX-CDI change log level

From Dev

How to change 2nd level index into 2nd level column in pandas DataFrame?

From Dev

How to change 2nd level index into 2nd level column in pandas DataFrame?

From Dev

How to set the log level on a class in log4j2 properties

From Dev

How to log an Event log in the Critical level?

From Dev

How to change level of all Log4J 1.x loggers?

From Dev

How do I change the logging level with Firestore JS SDK to only log Errors?

From Dev

How to apply a Systemd change in the log level, after modifying the systemd configuration file?

From Dev

How to change log4j2 logging path on tomcat?

From Dev

How to change Appender layout programmatically in log4j2?

From Dev

how to change htmllayout in log4j2

From Dev

How to change log4j2 logging path on tomcat?

From Dev

How to change SpringMVC logging level?

Related Related

  1. 1

    How to change cron log level?

  2. 2

    How to change the HADOOP log files location

  3. 3

    How to change python log level for unnamed logger?

  4. 4

    Programmatically change log level in Log4j2

  5. 5

    Log output too verbose - how to change log level?

  6. 6

    Log4j2 does not change logging level at runtime

  7. 7

    how to log only one level with log4j2?

  8. 8

    How to change the log level in semantic logging at run time?

  9. 9

    How to Change log level for particular users/threads at runtime

  10. 10

    how to change the log level to ERROR for systemd-resolved

  11. 11

    Is necessary to restart hadoop after changing log level?

  12. 12

    Logback log level change not working

  13. 13

    How to log FATAL (or any custom log level) with SLF4J and Log4j2

  14. 14

    Is it possible to change the log level for an application at compile time?

  15. 15

    Change log level for phantom embedded Cassandra

  16. 16

    Change log-level via mocking

  17. 17

    PAX-CDI change log level

  18. 18

    How to change 2nd level index into 2nd level column in pandas DataFrame?

  19. 19

    How to change 2nd level index into 2nd level column in pandas DataFrame?

  20. 20

    How to set the log level on a class in log4j2 properties

  21. 21

    How to log an Event log in the Critical level?

  22. 22

    How to change level of all Log4J 1.x loggers?

  23. 23

    How do I change the logging level with Firestore JS SDK to only log Errors?

  24. 24

    How to apply a Systemd change in the log level, after modifying the systemd configuration file?

  25. 25

    How to change log4j2 logging path on tomcat?

  26. 26

    How to change Appender layout programmatically in log4j2?

  27. 27

    how to change htmllayout in log4j2

  28. 28

    How to change log4j2 logging path on tomcat?

  29. 29

    How to change SpringMVC logging level?

HotTag

Archive