title: Separate log for library and application
body: <p>In my Python3 application, I use certain packages (like aiohttp, asyncio-redis , etc) , which have logging enabled in them by default. Now when I enable logging in my main application, the logs from aiohttp asyncio-redis are also coming in the log file.</p>
  
  <p>This is what I have done :</p>
  
  <pre><code>logging.basicConfig(filename=config['base_dir']+'/../access.log',   
                      level=logging.DEBUG,
                      format='%(levelname)s - %(message)s',
                      datefmt="%Y-%m-%d %H:%M:%S")
  </code></pre>
  
  <p>And my custom logs are logged like this <code>logging.debug(message)</code> . But when  I see the log file , then both package logs and my application logs are present there. How can I have them in different files ? I tried adding 2 loggers , with different file handlers as suggested in many SO threads , but that didn't help really. Infact all i was getting then was empty logs. </p>
  
  <p>So how can I have different logs for the aforementioned scenario ?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Here is my dictConfig :</p>
  
  <pre><code>{
      'version': 1,
      'disable_existing_loggers': True,
      'formatters': {
          'verbose': {
              'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
          },
          'simple': {
              'format': '%(levelname)s - %(message)s'
          }
      },
      'handlers': {
          'default': {
              'level': 'DEBUG',
              'formatter': 'simple',
              'class': 'logging.handlers.RotatingFileHandler',
              'filename': 'debug.log',
              'maxBytes': 1024
          },
          'access': {
              'level': 'INFO',
              'formatter': 'simple',
              'class': 'logging.handlers.RotatingFileHandler',
              'filename': 'access_log.log',
              'maxBytes': 1024
          }
      },
      'loggers': {
          'my_logger': {
              'handlers': ['default'],
              'level': 'DEBUG',
          },
          'aiohttp.access': {
              'handlers': ['access'],
              'level': 'INFO'
          }
      }
  }
  </code></pre>