Return-Path: X-Original-To: apmail-hadoop-common-dev-archive@www.apache.org Delivered-To: apmail-hadoop-common-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3B33B1173C for ; Thu, 22 May 2014 19:41:39 +0000 (UTC) Received: (qmail 24411 invoked by uid 500); 22 May 2014 19:41:37 -0000 Delivered-To: apmail-hadoop-common-dev-archive@hadoop.apache.org Received: (qmail 24331 invoked by uid 500); 22 May 2014 19:41:37 -0000 Mailing-List: contact common-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-dev@hadoop.apache.org Received: (qmail 24319 invoked by uid 99); 22 May 2014 19:41:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 May 2014 19:41:37 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of rarecactus@gmail.com designates 209.85.212.174 as permitted sender) Received: from [209.85.212.174] (HELO mail-wi0-f174.google.com) (209.85.212.174) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 May 2014 19:41:34 +0000 Received: by mail-wi0-f174.google.com with SMTP id r20so9891250wiv.13 for ; Thu, 22 May 2014 12:41:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=OVFkYcrTYKm0fM017Nt9KvluIG2+dByEi/jyma1RZUo=; b=fCztFayZdLM0Mo/QeRpG7NY2Lr4f4V8gVvEilbe/fVy3MCJ3W/fFV+tYarT/FmmQ+v uPjFkt7OkYVBMXRkUxWcswjJRXIiqkRYvKOF8n+WuuFjhRklmBsryAPHNNAEpVkgxQby mGX8LWPf1clyX/L9TsTtXWQinToGLCBlJMC0uB6Mq9CZHaXkfTlD3QpFkBgc11B6uSHJ GC3r17pmdD2FCS6HBthA3yyX+/b7VCxmynjvZ855t20AfJ463dcEUMHM1kutit5YtcT5 +YIZIHfrDObPZUp/sfgF9ZEx0AWetjLzydfxDk5UooC/viOWOq5v3XmqVEgO4tmrvKD0 bLDw== MIME-Version: 1.0 X-Received: by 10.180.85.163 with SMTP id i3mr18494637wiz.14.1400787671046; Thu, 22 May 2014 12:41:11 -0700 (PDT) Sender: rarecactus@gmail.com Received: by 10.194.122.135 with HTTP; Thu, 22 May 2014 12:41:11 -0700 (PDT) In-Reply-To: <537DFCFC.2080506@redhat.com> References: <537CA654.4090509@redhat.com> <537DFCFC.2080506@redhat.com> Date: Thu, 22 May 2014 12:41:11 -0700 X-Google-Sender-Auth: M-WaXoOpSF8P_U_o1aQomS7Ah64 Message-ID: Subject: Re: HADOOP_ROOT_LOGGER From: Colin McCabe To: Hadoop Common Content-Type: multipart/alternative; boundary=f46d0444eb0989e0e804fa024b52 X-Virus-Checked: Checked by ClamAV on apache.org --f46d0444eb0989e0e804fa024b52 Content-Type: text/plain; charset=UTF-8 It's not always practical to edit the log4j.properties file. For one thing, if you're using a management system, there may be many log4j properties sprinkled around the system, and it could be difficult to figure out which is the one you need to edit. For another, you may not (should not?) have permission to do this on a production cluster. Doing something like "HADOOP_ROOT_LOGGER="DEBUG,console" hadoop fs -cat /foo" has helped me diagnose problems in the past. best, Colin On Thu, May 22, 2014 at 6:34 AM, Robert Rati wrote: > In my experience the default HADOOP_ROOT_LOGGER definition will override > any root logger defined in log4j.properties, which is where the problems > have arisen. If the HADOOP_ROOT_LOGGER definition in hadoop-config.sh were > removed, wouldn't the root logger defined in the log4j.properties file be > used? Or do the client commands not read that configuration file? > > I'm trying to understand why the root logger should be defined outside of > the log4j.properties file. > > Rob > > > On 05/22/2014 12:53 AM, Vinayakumar B wrote: > >> Hi Robert, >> >> I understand your confusion. >> >> HADOOP_ROOT_LOGGER is set to default value "INFO,console" if it hasn't set >> for anything and logs will be displayed on the console itself. >> This will be true for any client commands you run. For ex: "hdfs dfs -ls >> /" >> >> But for the server scripts (hadoop-daemon.sh, yarn-daemon.sh, etc) >> HADOOP_ROOT_LOGGER will be set to "INFO, RFA" if HADOOP_ROOT_LOGGER env >> variable is not defined. >> So that all the log messages of the server daemons goto some log files and >> this will be maintained by RollingFileAppender. If you want to override >> all >> these default and set your own loglevel then define that as env variable >> HADOOP_ROOT_LOGGER. >> >> For ex: >> export HADOOP_ROOT_LOGGER="DEBUG,RFA" >> export above env variable and then start server scripts or execute >> client >> commands, all logs goto files and will be maintained by >> RollingFileAppender. >> >> >> Regards, >> Vinay >> >> >> On Wed, May 21, 2014 at 6:42 PM, Robert Rati wrote: >> >> I noticed in hadoop-config.sh there is this line: >>> >>> HADOOP_OPTS="$HADOOP_OPTS -Dhadoop.root.logger=${HADOOP_ >>> ROOT_LOGGER:-INFO,console}" >>> >>> which is setting a root logger if HADOOP_ROOT_LOGGER isn't set. Why is >>> this here.needed? There is a log4j.properties file provided that >>> defines a >>> default logger. I believe the line above will result in overriding >>> whatever is set for the root logger in the log4j.properties file. This >>> has >>> caused some confusion and hacks to work around this. >>> >>> Is there a reason not to remove the above code and just have all the >>> logger definitions in the log4j.properties file? Is there maybe a >>> compatibility concern? >>> >>> Rob >>> >>> >> >> >> --f46d0444eb0989e0e804fa024b52--