<?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 in force the audit logs in order to test the log rotation log4j configuration in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-in-force-the-audit-logs-in-order-to-test-the-log/m-p/232558#M82800</link>
    <description>&lt;P&gt;@Jay , second , do you think my configuration in log4j are corectly ? &lt;/P&gt;</description>
    <pubDate>Tue, 28 Aug 2018 17:45:18 GMT</pubDate>
    <dc:creator>mike_bronson7</dc:creator>
    <dc:date>2018-08-28T17:45:18Z</dc:date>
    <item>
      <title>how to in force the audit logs in order to test the log rotation log4j configuration</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-in-force-the-audit-logs-in-order-to-test-the-log/m-p/232555#M82797</link>
      <description>&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;we configured the &lt;STRONG&gt;Audit logging&lt;/STRONG&gt; for ResourceManager , ( in YARN --&amp;gt; Advanced yarn-log4j )&lt;/P&gt;&lt;P&gt;as the following:&lt;/P&gt;&lt;PRE&gt;# Audit logging for ResourceManager
rm.audit.logger=${hadoop.root.logger}
log4j.logger.org.apache.hadoop.yarn.server.resourcemanager.RMAuditLogger=${rm.audit.logger}
log4j.additivity.org.apache.hadoop.yarn.server.resourcemanager.RMAuditLogger=false
#log4j.appender.RMAUDIT=org.apache.log4j.DailyRollingFileAppender
log4j.appender.RMAUDIT.File=${yarn.log.dir}/rm-audit.log
log4j.appender.RMAUDIT.layout=org.apache.log4j.PatternLayout
log4j.appender.RMAUDIT.layout.ConversionPattern=%d{ISO8601} %p %c{2}: %m%n
#log4j.appender.RMAUDIT.DatePattern=.yyyy-MM-dd
log4j.appender.RMAUDIT=org.apache.log4j.RollingFileAppender
log4j.appender.RMAUDIT.MaxBackupIndex=5
log4j.appender.RMAUDIT.MaxFileSize=1MB
&lt;/PRE&gt;&lt;P&gt;and&lt;/P&gt;&lt;PRE&gt;
# Audit logging for NodeManager
nm.audit.logger=${hadoop.root.logger}
log4j.logger.org.apache.hadoop.yarn.server.nodemanager.NMAuditLogger=${nm.audit.logger}
log4j.additivity.org.apache.hadoop.yarn.server.nodemanager.NMAuditLogger=false
#log4j.appender.NMAUDIT=org.apache.log4j.DailyRollingFileAppender
log4j.appender.NMAUDIT.File=${yarn.log.dir}/nm-audit.log
log4j.appender.NMAUDIT.layout=org.apache.log4j.PatternLayout
log4j.appender.NMAUDIT.layout.ConversionPattern=%d{ISO8601} %p %c{2}: %m%n
#log4j.appender.NMAUDIT.DatePattern=.yyyy-MM-dd
log4j.appender.NMAUDIT=org.apache.log4j.RollingFileAppender
log4j.appender.NMAUDIT.MaxBackupIndex=5
log4j.appender.NMAUDIT.MaxFileSize=1MB&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and restart the YARN service&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;now we want to see if &lt;STRONG&gt;rm-audit.log &lt;/STRONG&gt;and &lt;STRONG&gt;nm-audit.log&lt;/STRONG&gt; are rotated , but because we set 1MB in MaxFileSize &lt;/P&gt;&lt;P&gt;it will take time until logs will be rotated&lt;/P&gt;&lt;PRE&gt;-rw-r--r--  1 yarn hadoop    4180 Aug 28 09:32 rm-audit.log&lt;/PRE&gt;&lt;P&gt;is it possible to in force the logs to increase quickly to 1M and rotated as &lt;STRONG&gt;rm-audit.log.1 &lt;/STRONG&gt;&lt;STRONG&gt;, &lt;/STRONG&gt;and &lt;STRONG&gt;rm-audit.log.2&lt;/STRONG&gt; , etc &lt;/P&gt;&lt;P&gt; so we can sure that our log4j configuration is correctly ?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 16:59:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-in-force-the-audit-logs-in-order-to-test-the-log/m-p/232555#M82797</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2018-08-28T16:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to in force the audit logs in order to test the log rotation log4j configuration</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-in-force-the-audit-logs-in-order-to-test-the-log/m-p/232556#M82798</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/26229/uribarih.html" nodeid="26229"&gt;@Michael Bronson&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Please try running some "Yarn Service Checks" from ambari UI 10-20 times and keep checking the "Active Resource Manager" logs&lt;STRONG&gt; "rm-audit.log"&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;You can also try running the following ambari API call to trigger the Yarn Service check in a for look 20-50 times and monitor the audit log growth.&lt;/P&gt;&lt;PRE&gt;# curl -sH "X-Requested-By: ambari" -u admin:admin -X POST -d '{"RequestInfo":{"context":"YARN Service Check","command":"YARN_SERVICE_CHECK"},"Requests/resource_filters":[{"service_name":"YARN"}]}'  &lt;A href="http://hdfcluster1.example.com:8080/api/v1/clusters/TestCluster/requests" target="_blank"&gt;http://hdfcluster1.example.com:8080/api/v1/clusters/TestCluster/requests&lt;/A&gt;
&lt;/PRE&gt;&lt;P&gt;.&lt;BR /&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 17:35:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-in-force-the-audit-logs-in-order-to-test-the-log/m-p/232556#M82798</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2018-08-28T17:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to in force the audit logs in order to test the log rotation log4j configuration</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-in-force-the-audit-logs-in-order-to-test-the-log/m-p/232557#M82799</link>
      <description>&lt;P&gt;@Jay what is the limit to set the variable - &lt;STRONG&gt;log4j.appender.NMAUDIT.MaxFileSize &lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;for example can we set 1MB as &lt;STRONG&gt; &lt;/STRONG&gt;&lt;STRONG&gt;log4j.appender.NMAUDIT.MaxFileSize=1MB&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 17:43:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-in-force-the-audit-logs-in-order-to-test-the-log/m-p/232557#M82799</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2018-08-28T17:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to in force the audit logs in order to test the log rotation log4j configuration</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-in-force-the-audit-logs-in-order-to-test-the-log/m-p/232558#M82800</link>
      <description>&lt;P&gt;@Jay , second , do you think my configuration in log4j are corectly ? &lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 17:45:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-in-force-the-audit-logs-in-order-to-test-the-log/m-p/232558#M82800</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2018-08-28T17:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to in force the audit logs in order to test the log rotation log4j configuration</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-in-force-the-audit-logs-in-order-to-test-the-log/m-p/232559#M82801</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/26229/uribarih.html" nodeid="26229"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/26229/uribarih.html" nodeid="26229"&gt;@Michael Bronson&lt;BR /&gt;&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;Log4j Specification says you can set the value to KB/MB .. so 1MB is fine for testing. Later you can have little larger value based on your requirement.&lt;/P&gt;&lt;P&gt;The default value will be 10MB as per the specs: &lt;A href="https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/RollingFileAppender.html#maxFileSize" target="_blank"&gt;https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/RollingFileAppender.html#maxFileSize&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Following ambari API call can trigger Yarn Service check multiple times to check the rm-audit.log growth.&lt;/P&gt;&lt;PRE&gt;# curl -sH "X-Requested-By: ambari" -u admin:admin -X POST -d '{"RequestInfo":{"context":"YARN Service Check","command":"YARN_SERVICE_CHECK"},"Requests/resource_filters":[{"service_name":"YARN"}]}'  &lt;A href="http://hdfcluster1.example.com:8080/api/v1/clusters/TestCluster/requests" target="_blank"&gt;http://hdfcluster1.example.com:8080/api/v1/clusters/TestCluster/requests&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;BR /&gt;&lt;A rel="user" href="https://community.cloudera.com/users/26229/uribarih.html" nodeid="26229"&gt;&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 17:45:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-in-force-the-audit-logs-in-order-to-test-the-log/m-p/232559#M82801</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2018-08-28T17:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to in force the audit logs in order to test the log rotation log4j configuration</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-in-force-the-audit-logs-in-order-to-test-the-log/m-p/232560#M82802</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/26229/uribarih.html" nodeid="26229"&gt;@Michael Bronson&lt;BR /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Yes, your configuration looks perfect.&lt;/P&gt;&lt;P&gt;I just changed the value of  1MB to 50KB and tested it on Resource Manager and it worked well&lt;/P&gt;&lt;PRE&gt;log4j.appender.RMAUDIT.MaxFileSize=50KB&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Rotation worked. So it should work well with 1MB or any other higher size as well.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;A rel="user" href="https://community.cloudera.com/users/26229/uribarih.html" nodeid="26229"&gt;&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 18:38:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-in-force-the-audit-logs-in-order-to-test-the-log/m-p/232560#M82802</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2018-08-28T18:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to in force the audit logs in order to test the log rotation log4j configuration</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-in-force-the-audit-logs-in-order-to-test-the-log/m-p/232561#M82803</link>
      <description>&lt;P&gt;@Jay we run the service check but it fail on python time out , is any other idea to increase the logs ?&lt;/P&gt;&lt;P&gt;second&lt;/P&gt;&lt;P&gt;from where we get the - &lt;STRONG&gt;yarn-yarn-resourcemanager&lt;/STRONG&gt;-....   files ?&lt;/P&gt;&lt;P&gt;they are not written in the log4j so I not understand how they create&lt;/P&gt;&lt;PRE&gt;-rw-r--r-- 1 yarn hadoop 1847 Aug 27 12:03 yarn-yarn-resourcemanager-master02.sys76.com.out.1
-rw-r--r-- 1 yarn hadoop 1052 Aug 27 12:05 yarn-yarn-resourcemanager-master02.sys76.com.log.10
-rw-r--r-- 1 yarn hadoop 1180 Aug 27 12:05 yarn-yarn-resourcemanager-master02.sys76.com.log.9&lt;/PRE&gt;&lt;OL&gt;
&lt;/OL&gt;</description>
      <pubDate>Tue, 28 Aug 2018 19:32:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-in-force-the-audit-logs-in-order-to-test-the-log/m-p/232561#M82803</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2018-08-28T19:32:31Z</dc:date>
    </item>
  </channel>
</rss>

