[
https://issues.apache.org/jira/browse/HADOOP-7984?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14152064#comment-14152064
]
Chris Nauroth commented on HADOOP-7984:
---------------------------------------
Akira, thanks for working on this, and thank you for including changes for both
bash and cmd. Allen, thanks for the ping.
The current patch's cmd scripts aren't working. The --loglevel argument is not
getting stripped off before passing to the java.exe call. Since java.exe
doesn't recognize --loglevel as an argument, it aborts immediately.
To fix this, you'll need to change 2 points in the code that strip away
"pre-processed" command line arguments. Unfortunately, this is code duplicated
across the 4 main entry points (perhaps unavoidable due to cmd limitations).
You'll need to make this change in hadoop.cmd, hdfs.cmd, mapred.cmd and
yarn.cmd. Do a find on "--config", and basically you can clone whatever is
done for --config and do the same for --loglevel. The first point will be near
the top of the file, and this is done to make sure command selection can find
the command in the first position. The second point will be in a subroutine
named {{make_command_arguments}}, and this is done to prevent passing the
argument to java.exe.
I see mapred.cmd is setting {{HADOOP_LOGLEVEL}}. I expect you won't need to do
that, because hadoop-config.cmd will get called through mapred.cmd. Same thing
for yarn-config.cmd. It calls hadoop-config.cmd, so you can drop this part of
the change.
Also, I have a small suggestion on the 4 documentation files that have this
line:
{code}
+| --loglevel loglevel | Overwrites the log level. Default is INFO.
{code}
Can we also briefly list the valid log level settings, just in case the user
isn't familiar with the logging libraries?
Thanks again. I can take it for another test run when a new patch is ready.
> Add hadoop --loglevel option to change log level
> ------------------------------------------------
>
> Key: HADOOP-7984
> URL: https://issues.apache.org/jira/browse/HADOOP-7984
> Project: Hadoop Common
> Issue Type: New Feature
> Components: scripts
> Reporter: Eli Collins
> Assignee: Akira AJISAKA
> Priority: Minor
> Labels: newbie
> Attachments: HADOOP-7984-branch-2.patch, HADOOP-7984.3.patch,
> HADOOP-7984.patch, HADOOP-7984.patch
>
>
> It would be helpful if bin/hadoop had --loglevel option to change the log
> level. Currently users need to set an env variable or prefix the command (eg
> "HADOOP_ROOT_LOGGER=DEBUG,console hadoop distcp") which isn't very user
> friendly.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)