HADOOP-11575. Daemon log documentation is misleading (Naganarasimha G R via aw)

This commit is contained in:
Allen Wittenauer 2015-02-17 07:00:00 -10:00
parent 8b787e2fdb
commit 72389c78db
4 changed files with 26 additions and 18 deletions

View File

@ -175,6 +175,9 @@ Trunk (Unreleased)
HADOOP-11495. Convert site documentation from apt to markdown HADOOP-11495. Convert site documentation from apt to markdown
(Masatake Iwasaki via aw) (Masatake Iwasaki via aw)
HADOOP-11575. Daemon log documentation is misleading
(Naganarasimha G R via aw)
BUG FIXES BUG FIXES
HADOOP-11473. test-patch says "-1 overall" even when all checks are +1 HADOOP-11473. test-patch says "-1 overall" even when all checks are +1

View File

@ -38,8 +38,8 @@
@InterfaceStability.Evolving @InterfaceStability.Evolving
public class LogLevel { public class LogLevel {
public static final String USAGES = "\nUsage: General options are:\n" public static final String USAGES = "\nUsage: General options are:\n"
+ "\t[-getlevel <host:httpPort> <name>]\n" + "\t[-getlevel <host:httpPort> <classname>]\n"
+ "\t[-setlevel <host:httpPort> <name> <level>]\n"; + "\t[-setlevel <host:httpPort> <classname> <level>]\n";
/** /**
* A command line implementation * A command line implementation
@ -106,7 +106,7 @@ public void doGet(HttpServletRequest request, HttpServletResponse response
if (logName != null) { if (logName != null) {
out.println("<br /><hr /><h3>Results</h3>"); out.println("<br /><hr /><h3>Results</h3>");
out.println(MARKER out.println(MARKER
+ "Submitted Log Name: <b>" + logName + "</b><br />"); + "Submitted Class Name: <b>" + logName + "</b><br />");
Log log = LogFactory.getLog(logName); Log log = LogFactory.getLog(logName);
out.println(MARKER out.println(MARKER
@ -131,10 +131,10 @@ else if (log instanceof Jdk14Logger) {
} }
static final String FORMS = "\n<br /><hr /><h3>Get / Set</h3>" static final String FORMS = "\n<br /><hr /><h3>Get / Set</h3>"
+ "\n<form>Log: <input type='text' size='50' name='log' /> " + "\n<form>Class Name: <input type='text' size='50' name='log' /> "
+ "<input type='submit' value='Get Log Level' />" + "<input type='submit' value='Get Log Level' />"
+ "</form>" + "</form>"
+ "\n<form>Log: <input type='text' size='50' name='log' /> " + "\n<form>Class Name: <input type='text' size='50' name='log' /> "
+ "Level: <input type='text' name='level' /> " + "Level: <input type='text' name='level' /> "
+ "<input type='submit' value='Set Log Level' />" + "<input type='submit' value='Set Log Level' />"
+ "</form>"; + "</form>";

View File

@ -212,14 +212,16 @@ Commands useful for administrators of a hadoop cluster.
### `daemonlog` ### `daemonlog`
Usage: `hadoop daemonlog -getlevel <host:port> <name> ` Usage: `hadoop daemonlog -setlevel <host:port> <name> <level> ` Usage: `hadoop daemonlog -getlevel <host:httpport> <classname> ` Usage: `hadoop daemonlog -setlevel <host:httpport> <classname> <level> `
| COMMAND\_OPTION | Description | | COMMAND\_OPTION | Description |
|:---- |:---- | |:---- |:---- |
| `-getlevel` *host:port* *name* | Prints the log level of the daemon running at *host:port*. This command internally connects to http://host:port/logLevel?log=name | | `-getlevel` *host:httpport* *classname* | Prints the log level of the log identified by a qualified *classname*, in the daemon running at *host:httpport*. This command internally connects to `http://<host:httpport>/logLevel?log=<classname>` |
| `-setlevel` *host:port* *name* *level* | Sets the log level of the daemon running at *host:port*. This command internally connects to http://host:port/logLevel?log=name | | `-setlevel` *host:httpport* *classname* *level* | Sets the log level of the log identified by a qualified *classname*, in the daemon running at *host:httpport*. This command internally connects to `http://<host:httpport>/logLevel?log=<classname>&level=<level>` |
Get/Set the log level for each daemon. Get/Set the log level for a Log identified by a qualified class name in the daemon.
Example: $ bin/hadoop daemonlog -setlevel 127.0.0.1:50070 org.apache.hadoop.hdfs.server.namenode.NameNode DEBUG
Files Files
----- -----

View File

@ -194,24 +194,27 @@ YARN Commands
Usage: Usage:
--------------------------------- ---------------------------------
yarn daemonlog -getlevel <host:port> <name> yarn daemonlog -getlevel <host:httpport> <classname>
yarn daemonlog -setlevel <host:port> <name> <level> yarn daemonlog -setlevel <host:httpport> <classname> <level>
--------------------------------- ---------------------------------
*---------------+--------------+ *---------------+--------------+
|| COMMAND_OPTIONS || Description | || COMMAND_OPTIONS || Description |
*---------------+--------------+ *---------------+--------------+
| -getlevel \<host:port\> \<name\> | Prints the log level of the daemon running | -getlevel \<host:httpport\> \<classname\> | Prints the log level of the log identified
| | at \<host:port\>. This command internally connects to | | by a qualified \<classname\>, in the daemon running at \<host:httpport\>. This
| | http://\<host:port\>/logLevel?log=\<name\> | | command internally connects to http://\<host:httpport\>/logLevel?log=\<classname\>
*---------------+--------------+ *---------------+--------------+
| -setlevel \<host:port\> \<name\> \<level\> | Sets the log level of the daemon | -setlevel \<host:httpport\> \<classname\> \<level\> | Sets the log level of the log
| | running at \<host:port\>. This command internally connects to | | identified by a qualified \<classname\> in the daemon running at \<host:httpport\>.
| | http://\<host:port\>/logLevel?log=\<name\> | | This command internally connects to http://\<host:httpport\>/logLevel?log=\<classname\>&level=\<level\>
*---------------+--------------+ *---------------+--------------+
Get/Set the log level for each daemon. Get/Set the log level for a Log identified by a qualified class name in the daemon.
----
Example: $ bin/yarn daemonlog -setlevel 127.0.0.1:8088 org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppImpl DEBUG
----
** <<<nodemanager>>> ** <<<nodemanager>>>