title: How to set my log file name dynamically from a script?
body: <p>I created a logging.conf file that works pretty well for one process. It logs everything correctly on the right file:</p>
  
  <pre><code>[loggers]
  keys=root
  
  [logger_root]
  handlers=screen,file
  level=DEBUG
  
  [formatters]
  keys=simple,complex
  
  [formatter_simple]
  format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
  
  [formatter_complex]
  format=%(asctime)s - %(name)s - %(levelname)s - %(module)s : %(lineno)d - %(message)s
  
  [handlers]
  keys=file,screen
  
  [handler_file]
  class=handlers.TimedRotatingFileHandler
  interval=midnight
  backupCount=7
  formatter=complex
  level=DEBUG
  args=('../logs/my_log.log',)
  
  [handler_screen]
  class=StreamHandler
  formatter=simple
  level=DEBUG
  args=(sys.stdout,)
  </code></pre>
  
  <p>And thats how I get my logger object inside my script:</p>
  
  <pre><code># Create logger
  logging.config.fileConfig('../logging.conf')
  logger = logging.getLogger()
  </code></pre>
  
  <p>The problem is - Now I have more than one process using the same script, and <strong><em>both are using the same log file</em></strong>, what is causing a concurrency error. 
  How can I set my log file name from inside of my script? There is a way to set the <code>args=('../logs/my_log.log',)</code> attribute of the <code>[handler_file]</code> dynamically? </p>