title: Kafka setting default retention log and testing
body: <p>I'm currently trying to test the kafka retention log using a new environment with <a href="https://github.com/spotify/docker-kafka" rel="nofollow noreferrer">docker-kafka</a>.</p>
  
  <p>I used <code>config/server.properties</code> and set the following for log retention:</p>
  
  <pre><code>log.retention.ms=2000
  log.retention.check.interval.ms=2000
  </code></pre>
  
  <p>Creating a topic and adding messages to it, I would test the size of the log by going to the location of the output logs. In my case it was at <code>/tmp/kafka-logs/&lt;topic-name&gt;</code>. Then just <code>ls -l</code> to see size in bytes.</p>
  
  <p>Adding more messages will increase size in bytes of the log file. If there is a better way to check the logs, please let me know.</p>
  
  <p>Running:
  <code>$ bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic &lt;topic-name&gt;</code></p>
  
  <p>I would get no config output. Log file is not deleted after 2000 ms.</p>
  
  <p>On Kafka docs:</p>
  
  <blockquote>
    <p>The number of milliseconds to keep a log file before deleting it (in
    milliseconds), If not set, the value in log.retention.minutes is used</p>
  </blockquote>
  
  <p>However, setting a topic-level configuration with:
  <code>$ bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic &lt;topic-name&gt; --config retention.ms=2000</code></p>
  
  <p>And checking configs on the title:
  <code>$ bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic &lt;topic-name&gt;</code></p>
  
  <p>I see that the retention is set for the topic. Also, checking the log size again, it might delete the logs after 2000 ms, but it does clear within a short time.</p>
  
  <p>How can I set default configurations for all topics created? Specifically related to log retention time?</p>
  
  <p>Also, an additional add-on question, are there config files for each individual topic created? I'm mainly asking because I know how to set topic-level configurations via cli, but was curious to see if these topic-level configs were saved somewhere.</p>