<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How to locate logs for local jobs in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-locate-logs-for-local-jobs/m-p/130305#M39396</link>
    <description>&lt;P&gt;The Apache Hive Wiki &lt;A href="https://cwiki.apache.org/confluence/display/Hive/GettingStarted"&gt;https://cwiki.apache.org/confluence/display/Hive/GettingStarted&lt;/A&gt; has details on logging, including local mode and version differences.&lt;/P&gt;&lt;P&gt;I have pasted the key info below but see link above for more.&lt;/P&gt;&lt;H3&gt;Hive Logging&lt;/H3&gt;&lt;P&gt;Hive uses log4j for logging. By default logs are not emitted to the console by the CLI. The default logging level is &lt;CODE&gt;WARN&lt;/CODE&gt; for Hive releases prior to 0.13.0. Starting with Hive 0.13.0, the default logging level is &lt;CODE&gt;INFO&lt;/CODE&gt;.&lt;/P&gt;&lt;P&gt;The logs are stored in the directory &lt;CODE&gt;/tmp/&amp;lt;&lt;EM&gt;user.name&lt;/EM&gt;&amp;gt;&lt;/CODE&gt;:&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;/tmp/&amp;lt;&lt;EM&gt;user.name&lt;/EM&gt;&amp;gt;/hive.log&lt;/CODE&gt;
Note: In &lt;A href="https://cwiki.apache.org/confluence/display/Hive/GettingStarted#GettingStarted-Hive,Map-ReduceandLocal-Mode"&gt;local mode&lt;/A&gt;, prior to Hive 0.13.0 the log file name was "&lt;CODE&gt;.log&lt;/CODE&gt;" instead of "&lt;CODE&gt;hive.log&lt;/CODE&gt;". This bug was fixed in release 0.13.0 (see &lt;A href="https://issues.apache.org/jira/browse/HIVE-5528"&gt;HIVE-5528&lt;/A&gt; and &lt;A href="https://issues.apache.org/jira/browse/HIVE-5676"&gt;HIVE-5676&lt;/A&gt;).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;To configure a different log location, set &lt;CODE&gt;hive.log.dir&lt;/CODE&gt; in $HIVE_HOME/conf/hive-log4j.properties. Make sure the directory has the sticky bit set (&lt;CODE&gt;chmod 1777 &amp;lt;&lt;EM&gt;dir&lt;/EM&gt;&amp;gt;&lt;/CODE&gt;).&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;hive.log.dir=&lt;EM&gt;&amp;lt;other_location&amp;gt;&lt;/EM&gt;&lt;/CODE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;If the user wishes, the logs can be emitted to the console by adding the arguments shown below:&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;bin/hive --hiveconf hive.root.logger=INFO,console  //for HiveCLI (deprecated)&lt;/CODE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;CODE&gt;bin/hiveserver2 --hiveconf hive.root.logger=INFO,console&lt;/CODE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Alternatively, the user can change the logging level only by using:&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;bin/hive --hiveconf hive.root.logger=INFO,DRFA //for HiveCLI (deprecated)&lt;/CODE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;CODE&gt;bin/hiveserver2 --hiveconf hive.root.logger=INFO,DRFA&lt;/CODE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Another option for logging is TimeBasedRollingPolicy (applicable for Hive &lt;A href="https://issues.apache.org/jira/browse/HIVE/fixforversion/12328723"&gt;0.15.0&lt;/A&gt; and above, &lt;A href="https://issues.apache.org/jira/browse/HIVE-9001"&gt;HIVE-9001&lt;/A&gt;) by providing DAILY option as shown below:&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;bin/hive --hiveconf hive.root.logger=INFO,DAILY //for HiveCLI (deprecated)&lt;/CODE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;CODE&gt;bin/hiveserver2 --hiveconf hive.root.logger=INFO,DAILY&lt;/CODE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Note that setting &lt;CODE&gt;hive.root.logger&lt;/CODE&gt; via the 'set' command does not change logging properties since they are determined at initialization time.&lt;/P&gt;&lt;P&gt;Hive also stores query logs on a per Hive session basis in &lt;CODE&gt;/tmp/&amp;lt;user.name&amp;gt;/&lt;/CODE&gt;, but can be configured in &lt;A href="https://cwiki.apache.org/confluence/display/Hive/AdminManual+Configuration"&gt;hive-site.xml&lt;/A&gt; with the &lt;CODE&gt;hive.querylog.location&lt;/CODE&gt; property.&lt;/P&gt;&lt;P&gt;Logging during Hive execution on a Hadoop cluster is controlled by Hadoop configuration. Usually Hadoop will produce one log file per map and reduce task stored on the cluster machine(s) where the task was executed. The log files can be obtained by clicking through to the Task Details page from the Hadoop JobTracker Web UI.&lt;/P&gt;&lt;P&gt;When using local mode (using &lt;CODE&gt;mapreduce.framework.name=local&lt;/CODE&gt;), Hadoop/Hive execution logs are produced on the client machine itself. Starting with release 0.6 – Hive uses the &lt;CODE&gt;hive-exec-log4j.properties&lt;/CODE&gt; (falling back to &lt;CODE&gt;hive-log4j.properties&lt;/CODE&gt; only if it's missing) to determine where these logs are delivered by default. The default configuration file produces one log file per query executed in local mode and stores it under &lt;CODE&gt;/tmp/&amp;lt;user.name&amp;gt;&lt;/CODE&gt;. The intent of providing a separate configuration file is to enable administrators to centralize execution log capture if desired (on a NFS file server for example). Execution logs are invaluable for debugging run-time errors.&lt;/P&gt;</description>
    <pubDate>Fri, 02 Sep 2016 04:02:58 GMT</pubDate>
    <dc:creator>gkeys</dc:creator>
    <dc:date>2016-09-02T04:02:58Z</dc:date>
    <item>
      <title>How to locate logs for local jobs</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-locate-logs-for-local-jobs/m-p/130304#M39395</link>
      <description>&lt;P&gt;I was able to successfully setup Hive 1.2.1 with Hadoop 2.7.1, using yarn as the mapreduce framework. For debugging certain queries (am trying to attach a debugger and go through the operators), now I'm trying to use the local mode. i.e. &lt;/P&gt;&lt;P&gt;After switching to the local mode, I could see queries running, but I can't locate the logs for those jobs. Checked in the log folder but can't find any folder (I was looking for a syslog put inside a folder specific to a particular job), or a log starting with job id. How can I get those logs?&lt;/P&gt;&lt;P&gt;These are all the properties I have in mapred-site.xml&lt;/P&gt;&lt;PRE&gt;  &amp;lt;property&amp;gt;
    &amp;lt;name&amp;gt;mapreduce.framework.name&amp;lt;/name&amp;gt;
    &amp;lt;value&amp;gt;local&amp;lt;/value&amp;gt;
  &amp;lt;/property&amp;gt;
   &amp;lt;property&amp;gt;
    &amp;lt;name&amp;gt;mapred.child.java.opts&amp;lt;/name&amp;gt;
    &amp;lt;value&amp;gt;-Xmx512m&amp;lt;/value&amp;gt;
  &amp;lt;/property&amp;gt;
  &amp;lt;property&amp;gt;
    &amp;lt;name&amp;gt;mapred.job.tracker&amp;lt;/name&amp;gt;
    &amp;lt;value&amp;gt;local&amp;lt;/value&amp;gt;
  &amp;lt;/property&amp;gt;

&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Sep 2016 14:46:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-locate-logs-for-local-jobs/m-p/130304#M39395</guid>
      <dc:creator>jaadds</dc:creator>
      <dc:date>2016-09-01T14:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to locate logs for local jobs</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-locate-logs-for-local-jobs/m-p/130305#M39396</link>
      <description>&lt;P&gt;The Apache Hive Wiki &lt;A href="https://cwiki.apache.org/confluence/display/Hive/GettingStarted"&gt;https://cwiki.apache.org/confluence/display/Hive/GettingStarted&lt;/A&gt; has details on logging, including local mode and version differences.&lt;/P&gt;&lt;P&gt;I have pasted the key info below but see link above for more.&lt;/P&gt;&lt;H3&gt;Hive Logging&lt;/H3&gt;&lt;P&gt;Hive uses log4j for logging. By default logs are not emitted to the console by the CLI. The default logging level is &lt;CODE&gt;WARN&lt;/CODE&gt; for Hive releases prior to 0.13.0. Starting with Hive 0.13.0, the default logging level is &lt;CODE&gt;INFO&lt;/CODE&gt;.&lt;/P&gt;&lt;P&gt;The logs are stored in the directory &lt;CODE&gt;/tmp/&amp;lt;&lt;EM&gt;user.name&lt;/EM&gt;&amp;gt;&lt;/CODE&gt;:&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;/tmp/&amp;lt;&lt;EM&gt;user.name&lt;/EM&gt;&amp;gt;/hive.log&lt;/CODE&gt;
Note: In &lt;A href="https://cwiki.apache.org/confluence/display/Hive/GettingStarted#GettingStarted-Hive,Map-ReduceandLocal-Mode"&gt;local mode&lt;/A&gt;, prior to Hive 0.13.0 the log file name was "&lt;CODE&gt;.log&lt;/CODE&gt;" instead of "&lt;CODE&gt;hive.log&lt;/CODE&gt;". This bug was fixed in release 0.13.0 (see &lt;A href="https://issues.apache.org/jira/browse/HIVE-5528"&gt;HIVE-5528&lt;/A&gt; and &lt;A href="https://issues.apache.org/jira/browse/HIVE-5676"&gt;HIVE-5676&lt;/A&gt;).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;To configure a different log location, set &lt;CODE&gt;hive.log.dir&lt;/CODE&gt; in $HIVE_HOME/conf/hive-log4j.properties. Make sure the directory has the sticky bit set (&lt;CODE&gt;chmod 1777 &amp;lt;&lt;EM&gt;dir&lt;/EM&gt;&amp;gt;&lt;/CODE&gt;).&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;hive.log.dir=&lt;EM&gt;&amp;lt;other_location&amp;gt;&lt;/EM&gt;&lt;/CODE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;If the user wishes, the logs can be emitted to the console by adding the arguments shown below:&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;bin/hive --hiveconf hive.root.logger=INFO,console  //for HiveCLI (deprecated)&lt;/CODE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;CODE&gt;bin/hiveserver2 --hiveconf hive.root.logger=INFO,console&lt;/CODE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Alternatively, the user can change the logging level only by using:&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;bin/hive --hiveconf hive.root.logger=INFO,DRFA //for HiveCLI (deprecated)&lt;/CODE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;CODE&gt;bin/hiveserver2 --hiveconf hive.root.logger=INFO,DRFA&lt;/CODE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Another option for logging is TimeBasedRollingPolicy (applicable for Hive &lt;A href="https://issues.apache.org/jira/browse/HIVE/fixforversion/12328723"&gt;0.15.0&lt;/A&gt; and above, &lt;A href="https://issues.apache.org/jira/browse/HIVE-9001"&gt;HIVE-9001&lt;/A&gt;) by providing DAILY option as shown below:&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;bin/hive --hiveconf hive.root.logger=INFO,DAILY //for HiveCLI (deprecated)&lt;/CODE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;CODE&gt;bin/hiveserver2 --hiveconf hive.root.logger=INFO,DAILY&lt;/CODE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Note that setting &lt;CODE&gt;hive.root.logger&lt;/CODE&gt; via the 'set' command does not change logging properties since they are determined at initialization time.&lt;/P&gt;&lt;P&gt;Hive also stores query logs on a per Hive session basis in &lt;CODE&gt;/tmp/&amp;lt;user.name&amp;gt;/&lt;/CODE&gt;, but can be configured in &lt;A href="https://cwiki.apache.org/confluence/display/Hive/AdminManual+Configuration"&gt;hive-site.xml&lt;/A&gt; with the &lt;CODE&gt;hive.querylog.location&lt;/CODE&gt; property.&lt;/P&gt;&lt;P&gt;Logging during Hive execution on a Hadoop cluster is controlled by Hadoop configuration. Usually Hadoop will produce one log file per map and reduce task stored on the cluster machine(s) where the task was executed. The log files can be obtained by clicking through to the Task Details page from the Hadoop JobTracker Web UI.&lt;/P&gt;&lt;P&gt;When using local mode (using &lt;CODE&gt;mapreduce.framework.name=local&lt;/CODE&gt;), Hadoop/Hive execution logs are produced on the client machine itself. Starting with release 0.6 – Hive uses the &lt;CODE&gt;hive-exec-log4j.properties&lt;/CODE&gt; (falling back to &lt;CODE&gt;hive-log4j.properties&lt;/CODE&gt; only if it's missing) to determine where these logs are delivered by default. The default configuration file produces one log file per query executed in local mode and stores it under &lt;CODE&gt;/tmp/&amp;lt;user.name&amp;gt;&lt;/CODE&gt;. The intent of providing a separate configuration file is to enable administrators to centralize execution log capture if desired (on a NFS file server for example). Execution logs are invaluable for debugging run-time errors.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 04:02:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-locate-logs-for-local-jobs/m-p/130305#M39396</guid>
      <dc:creator>gkeys</dc:creator>
      <dc:date>2016-09-02T04:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to locate logs for local jobs</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-locate-logs-for-local-jobs/m-p/130306#M39397</link>
      <description>&lt;P&gt;Thanks!!. That was what I was looking for.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Sep 2016 18:43:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-locate-logs-for-local-jobs/m-p/130306#M39397</guid>
      <dc:creator>jaadds</dc:creator>
      <dc:date>2016-09-04T18:43:35Z</dc:date>
    </item>
  </channel>
</rss>

