<?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: Better way the change Logging directories for Ambari-Server and Ambari-Agent? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Better-way-the-change-Logging-directories-for-Ambari-Server/m-p/94322#M7618</link>
    <description>&lt;A rel="user" href="https://community.cloudera.com/users/175/dstreever.html" nodeid="175"&gt;@dstreever@hortonworks.com&lt;/A&gt;&lt;P&gt; David after looking a little more closely I was wrong. You can specify the ambari-agent logging directory (but not file name) using the environment variable "AMBARI_AGENT_LOG_DIR". Hope that helps&lt;/P&gt;</description>
    <pubDate>Sat, 26 Sep 2015 02:23:06 GMT</pubDate>
    <dc:creator>jdyer</dc:creator>
    <dc:date>2015-09-26T02:23:06Z</dc:date>
    <item>
      <title>Better way the change Logging directories for Ambari-Server and Ambari-Agent?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Better-way-the-change-Logging-directories-for-Ambari-Server/m-p/94320#M7616</link>
      <description>&lt;P&gt;For Ambari-Server, I currently make adjustments to:&lt;/P&gt;&lt;P&gt;/etc/ambari-server/conf/log4j.properties &lt;/P&gt;&lt;P&gt;And for the Agent, I have to create a symlink to redirect /var/log/ambari-agent.&lt;/P&gt;&lt;P&gt;Is there a better method?&lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2015 01:35:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Better-way-the-change-Logging-directories-for-Ambari-Server/m-p/94320#M7616</guid>
      <dc:creator>dstreev</dc:creator>
      <dc:date>2015-09-26T01:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Better way the change Logging directories for Ambari-Server and Ambari-Agent?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Better-way-the-change-Logging-directories-for-Ambari-Server/m-p/94321#M7617</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/175/dstreever.html" nodeid="175"&gt;@dstreever@hortonworks.com&lt;/A&gt; David for ambari-agent the "LOGFILE" directory is hardcoded in the /usr/sbin/ambari-agent which is called directly from the ambari-agent start script. It isn't possible right now to paramatize this value. You could change the value of "LOGFILE" in /usr/sbin/ambari-agent but using a symlink is the probably the best option. "LOGFILE" is located on line 45.&lt;/P&gt;&lt;PRE&gt;LOGFILE=/var/log/ambari-agent/ambari-agent.log&lt;/PRE&gt;</description>
      <pubDate>Sat, 26 Sep 2015 02:12:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Better-way-the-change-Logging-directories-for-Ambari-Server/m-p/94321#M7617</guid>
      <dc:creator>jdyer</dc:creator>
      <dc:date>2015-09-26T02:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Better way the change Logging directories for Ambari-Server and Ambari-Agent?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Better-way-the-change-Logging-directories-for-Ambari-Server/m-p/94322#M7618</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/175/dstreever.html" nodeid="175"&gt;@dstreever@hortonworks.com&lt;/A&gt;&lt;P&gt; David after looking a little more closely I was wrong. You can specify the ambari-agent logging directory (but not file name) using the environment variable "AMBARI_AGENT_LOG_DIR". Hope that helps&lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2015 02:23:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Better-way-the-change-Logging-directories-for-Ambari-Server/m-p/94322#M7618</guid>
      <dc:creator>jdyer</dc:creator>
      <dc:date>2015-09-26T02:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Better way the change Logging directories for Ambari-Server and Ambari-Agent?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Better-way-the-change-Logging-directories-for-Ambari-Server/m-p/94323#M7619</link>
      <description>&lt;P&gt;If you feel like hacking, I think you can also do this via AmbariConfig.py: &lt;/P&gt;&lt;P&gt;ambari-agent.log:&lt;/P&gt;&lt;P&gt;/usr/lib/python2.6/site-packages/ambari_agent/AmbariConfig.py: &lt;/P&gt;&lt;PRE&gt;  @staticmethod
  def getLogFile():
    if 'AMBARI_AGENT_LOG_DIR' in os.environ:
      return os.path.join(os.environ['AMBARI_AGENT_LOG_DIR'], "ambari-agent.log")
    else:
#      return os.path.join(os.sep, "var", "log", "ambari-agent", "ambari-agent.log")
      return "/new_log_dir/ambari-agent.log" 
&lt;/PRE&gt;&lt;P&gt;ambari-agent.out:&lt;/P&gt;&lt;P&gt;/usr/lib/python2.6/site-packages/ambari_agent/AmbariConfig.py:&lt;/P&gt;&lt;PRE&gt;  @staticmethod
  def getOutFile():
    if 'AMBARI_AGENT_OUT_DIR' in os.environ:
      return os.path.join(os.environ['AMBARI_AGENT_OUT_DIR'], "ambari-agent.out")
    else:
#      return os.path.join(os.sep, "var", "log", "ambari-agent", "ambari-agent.out")
      return "/new_log_dir/ambari-agent.out"      
&lt;/PRE&gt;&lt;P&gt;ambari-server.out: &lt;/P&gt;&lt;P&gt;/usr/lib/python2.6/site-packages/ambari_server/serverConfiguration.py:&lt;/P&gt;&lt;PRE&gt;class ServerConfigDefaults(object):
  def __init__(self):
    self.JAVA_SHARE_PATH = "/usr/share/java"
#    self.OUT_DIR = os.sep + os.path.join("var", "log", "ambari-server")
    self.OUT_DIR = os.sep + os.path.join("new_log_dir", "ambari-server")
    self.SERVER_OUT_FILE = os.path.join(self.OUT_DIR, "ambari-server.out")
    self.SERVER_LOG_FILE = os.path.join(self.OUT_DIR, "ambari-server.log")
    self.ROOT_FS_PATH = os.sep
&lt;/PRE&gt;&lt;P&gt;ambari-server.log: &lt;/P&gt;&lt;P&gt;vi /etc/ambari-server/conf/log4j.properties:&lt;/P&gt;&lt;PRE&gt;# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender
#log4j.appender.file.File=/var/log/ambari-server/ambari-server.log
log4j.appender.file.File=/new_log_dir/ambari-server.log
log4j.appender.file.MaxFileSize=80MB
log4j.appender.file.MaxBackupIndex=60
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{DATE} %5p [%t] %c{1}:%L - %m%n
&lt;/PRE&gt;</description>
      <pubDate>Sat, 26 Sep 2015 02:38:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Better-way-the-change-Logging-directories-for-Ambari-Server/m-p/94323#M7619</guid>
      <dc:creator>wgonzalez</dc:creator>
      <dc:date>2015-09-26T02:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: Better way the change Logging directories for Ambari-Server and Ambari-Agent?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Better-way-the-change-Logging-directories-for-Ambari-Server/m-p/94324#M7620</link>
      <description>&lt;P&gt;For ambari-agent, use the &lt;STRONG&gt;$AMBARI_AGENT_LOG_DIR&lt;/STRONG&gt; environment variable. There is a typo in /usr/sbin/ambari-agent shell script though:&lt;/P&gt;&lt;P&gt;Just change&lt;EM&gt; &lt;STRONG&gt;$AMBARI_LOG_DIR&lt;/STRONG&gt;&lt;/EM&gt; to &lt;STRONG&gt;$AMBARI_AGENT_LOG_DIR&lt;/STRONG&gt; in &lt;EM&gt;/usr/sbin/ambari-agent&lt;/EM&gt;. Now set &lt;STRONG&gt;$AMBARI_AGENT_LOG_DIR&lt;/STRONG&gt; to the desired location.&lt;/P&gt;&lt;P&gt;The bug has been fixed in trunk:  &lt;A href="https://reviews.apache.org/r/37990/" target="_blank"&gt;https://reviews.apache.org/r/37990/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For ambari-server, there is no such environment variable. I'll file a bug for this and have it triaged.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2015 10:16:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Better-way-the-change-Logging-directories-for-Ambari-Server/m-p/94324#M7620</guid>
      <dc:creator>nsomasundaram</dc:creator>
      <dc:date>2015-10-28T10:16:53Z</dc:date>
    </item>
  </channel>
</rss>

