title: Append environment variables in log format in Python
body: <p>I have a Rabbitmq consumer that gets messages from another service with a unique_id. I need to set some environment variables which prints in every log within that process message block. </p>
  
  <pre><code>import logging
  import os
  
  LOG_FORMAT = '%(asctime)s - %(levelname)-7s %(message)s  : unique_id  : os.getenv("unique_id","1")'
  logging.basicConfig(level=logging.INFO, format=LOG_FORMAT)
  </code></pre>
  
  <p>also updating os var before message process block:</p>
  
  <pre><code>os.environ["unique_id"] = new_unique_id
  </code></pre>
  
  <p>however, with the above code log format is not taking the latest value of unique_id. It always prints 1. Seems it only takes value while initialization.</p>
  
  <p>I only want to append unique_id for each log message in that particular block with updated unique_id. 
  As it is a very big project so I don't want to append this to each log manually. I want to use a log format here. </p>
  
  <p>New to the python, so not able to understand what I am doing wrong. </p>