daemonlog

Gets/sets the log level for a log identified by a qualified class name in the daemon dynamically.

By default, this command sends an HTTP request, but this can be overridden by using -protocol https to send an HTTPS request.

Note that the setting isn’t permanent and will reset when the daemon is restarted. This command works by sending an HTTP/HTTPS request to the daemon’s internal Jetty servlet, so it supports the following daemons:

  • Common

    • key management server

  • HDFS

    • name node

    • secondary name node

    • data node

    • journal node

    • HttpFS server

  • YARN

    • resource manager

    • node manager

    • Timeline server

The usage is as follows:

$ hadoop daemonlog -getlevel <host:port> <classname> [-protocol (http|https)]
$ hadoop daemonlog -setlevel <host:port> <classname> <level> [-protocol (http|https)]
Arguments

-getlevel host:port classname [-protocol (httphttps)]

Prints the log level of the log identified by a qualified classname, in the daemon running at host:port. The -protocol flag specifies the protocol for connection

-setlevel host:port classname level [-protocol (httphttps)]

Sets the log level of the log identified by a qualified classname, in the daemon running at host:port. The -protocol flag specifies the protocol for connection

Examples:

$ bin/hadoop daemonlog -setlevel 127.0.0.1:9870 org.apache.hadoop.hdfs.server.namenode.NameNode DEBUG
$ bin/hadoop daemonlog -getlevel 127.0.0.1:9871 org.apache.hadoop.hdfs.server.namenode.NameNode DEBUG -protocol https
Found a mistake? Seleсt text and press Ctrl+Enter to report it