<?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 Controlling size of the kafka.out log file. in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Controlling-size-of-the-kafka-out-log-file/m-p/96053#M59402</link>
    <description>&lt;P&gt;Kafka error logs are getting filled bringing the kafka down.Looking for options to purge the old kafka errors logs.&lt;/P&gt;&lt;P&gt;Logs that are getting fillled are server.log.**. kafka.out.&lt;/P&gt;</description>
    <pubDate>Tue, 27 Oct 2015 16:55:31 GMT</pubDate>
    <dc:creator>Jagatheeshr</dc:creator>
    <dc:date>2015-10-27T16:55:31Z</dc:date>
    <item>
      <title>Controlling size of the kafka.out log file.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Controlling-size-of-the-kafka-out-log-file/m-p/96053#M59402</link>
      <description>&lt;P&gt;Kafka error logs are getting filled bringing the kafka down.Looking for options to purge the old kafka errors logs.&lt;/P&gt;&lt;P&gt;Logs that are getting fillled are server.log.**. kafka.out.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2015 16:55:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Controlling-size-of-the-kafka-out-log-file/m-p/96053#M59402</guid>
      <dc:creator>Jagatheeshr</dc:creator>
      <dc:date>2015-10-27T16:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: Controlling size of the kafka.out log file.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Controlling-size-of-the-kafka-out-log-file/m-p/96054#M59403</link>
      <description>&lt;P&gt;@jramakrishna@hortonworks.com&lt;/P&gt;&lt;P&gt;Please see &lt;A target="_blank" href="http://kafka.apache.org/07/configuration.html"&gt;this&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;log.retention.bytes -1

The amount of data to retain in the log for each topic-partitions. Note that this is the limit per-partition so multiply by the number of partitions to get the total data retained for the topic. Also note that if both log.retention.hours and log.retention.bytes are both set we delete a segment when either limit is exceeded. This setting can be overridden on a per-topic basis (see the per-topic configuration section).&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Oct 2015 17:27:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Controlling-size-of-the-kafka-out-log-file/m-p/96054#M59403</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2015-10-27T17:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: Controlling size of the kafka.out log file.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Controlling-size-of-the-kafka-out-log-file/m-p/96055#M59404</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/189/jramakrishnan.html" nodeid="189" target="_blank"&gt;@jramakrishnan@hortonworks.com&lt;/A&gt; you need to change the following log4j property&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="339-img1.png" style="width: 1136px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/24021i5F2428BFC04BBAAC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="339-img1.png" alt="339-img1.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 12:54:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Controlling-size-of-the-kafka-out-log-file/m-p/96055#M59404</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2019-08-19T12:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Controlling size of the kafka.out log file.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Controlling-size-of-the-kafka-out-log-file/m-p/96056#M59405</link>
      <description>&lt;P&gt;Let's clarify some confusion - we're not talking about Kafka data logs, but rather logging of the Kafka broker process itself. So, your logs are getting big? Several solutions, based on your appetite for coding and linux admin automation.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Reduce Logging Output to WARN&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Kafka broker is quite chatty about client connections, and that fills up logs quickly. Update the logger level for 'server.log' to write only WARN and above. E.g. in Ambari, go to &lt;STRONG&gt;Kafka -&amp;gt; Config -&amp;gt; Advanced kafka-log4j&lt;/STRONG&gt; section. Scroll down and find the &lt;STRONG&gt;log4j.logger.kafka&lt;/STRONG&gt; entry, modify the level to be &lt;STRONG&gt;WARN&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="338-screenshot.png" style="width: 890px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/24020iEC3FF4DD7F39F0BE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="338-screenshot.png" alt="338-screenshot.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Change hourly logs to daily and rotate&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;By default, those logs in question will create hourly files. If you pair it with some external rotation/deletion policy, might want to switch to &lt;STRONG&gt;daily&lt;/STRONG&gt; logs instead of hourly. In the same section above, find and update the &lt;STRONG&gt;log4j.appender&lt;/STRONG&gt;&lt;STRONG&gt;.kafkaAppender&lt;/STRONG&gt;&lt;STRONG&gt;.DatePattern&lt;/STRONG&gt; . See the reference docs for syntax: &lt;A target="_blank" href="https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html" rel="nofollow noopener noreferrer"&gt;https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Use LogRotate&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Research &lt;A target="_blank" href="http://linuxcommand.org/man_pages/logrotate8.html" rel="nofollow noopener noreferrer"&gt;http://linuxcommand.org/man_pages/logrotate8.html&lt;/A&gt; . Powerful, but given that you already have log4j in Kafka, might be redundant. An option if you want to go more on the admin side than app dev/ops.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Use an enhanced Log4j rolling appender with MaxBackupIndex&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The version of log4j shipped by default doesn't support &lt;STRONG&gt;MaxBackupIndex&lt;/STRONG&gt; attribute on the &lt;STRONG&gt;DailyRollingFileAppender&lt;/STRONG&gt;. You can, however, find it in many libraries on the internet or quickly compile it yourself from e.g. this: &lt;A target="_blank" href="http://wiki.apache.org/logging-log4j/DailyRollingFileAppender" rel="nofollow noopener noreferrer"&gt;http://wiki.apache.org/logging-log4j/DailyRollingFileAppender&lt;/A&gt; . Once you drop the extra jar in Kafka's &lt;STRONG&gt;lib&lt;/STRONG&gt; directory, you could add the &lt;STRONG&gt;log4j.logger.kafka.MaxBackupIndex&lt;/STRONG&gt; attribute in the config to specify how many of those log files to keep around.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WARNING&lt;/STRONG&gt;: using the MaxBackupIndex also means logs will be &lt;EM&gt;lost&lt;/EM&gt;&lt;STRONG&gt; &lt;/STRONG&gt;if not picked up in time.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 12:54:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Controlling-size-of-the-kafka-out-log-file/m-p/96056#M59405</guid>
      <dc:creator>andrewg</dc:creator>
      <dc:date>2019-08-19T12:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Controlling size of the kafka.out log file.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Controlling-size-of-the-kafka-out-log-file/m-p/96057#M59406</link>
      <description>&lt;P&gt;Thanks a lot for all the pointers.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2015 00:46:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Controlling-size-of-the-kafka-out-log-file/m-p/96057#M59406</guid>
      <dc:creator>Jagatheeshr</dc:creator>
      <dc:date>2015-10-28T00:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Controlling size of the kafka.out log file.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Controlling-size-of-the-kafka-out-log-file/m-p/96058#M59407</link>
      <description>&lt;P&gt;Hi Neeraj.I am mainly looking at log4j stuff.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2015 00:47:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Controlling-size-of-the-kafka-out-log-file/m-p/96058#M59407</guid>
      <dc:creator>Jagatheeshr</dc:creator>
      <dc:date>2015-10-28T00:47:23Z</dc:date>
    </item>
  </channel>
</rss>

