title: Dynamically change logging formatter in python?
body: <p>I am using python logging, at one point of program I need a logging format like this,</p>
  <pre><code>&quot;[%(asctime)s] [%(service_id)s] [%(
      levelname)s] [%(hostname)s] [%(host_ip)s] [%(client_agent)s] [%(client_ip)s] [%(filename)20s:%(lineno)d]&quot;
  </code></pre>
  <p>at another point I need a format like this and so on,</p>
  <pre><code> &quot;[%(asctime)s] [%(service_id)s] [%(
      levelname)s] [%(hostname)s] [%(host_ip)s]&quot;
  </code></pre>
  <p>My logging format should dynamically change through out the program. How to achieve this?</p>