title: Django: Setting LOGGER doesn't work
body: <p>I'm having trouble with Django's logging system. My goal is to log all types of logs to the files, and only log to the console if <code>DEBUG</code> is set to <code>True</code> (which it is right now)</p>
  
  <p>As it is, the log files remain blank (although they are created by Django). When I start the server (using <code>python3 manage.py runserver</code>) I see the following in the shell:  </p>
  
  <pre><code>Warning!
  Error!
  
  ... (normal server stuff)
  </code></pre>
  
  <p>But nothing is written to any of the log files.</p>
  
  <p>And if I un-comment <code>logging.error('== == START LOGGER == ==')</code> and <code>logr.setLevel('DEBUG')</code> in <strong>__init__.py</strong>, then the shell reads:  </p>
  
  <pre><code>ERROR:root:== == START LOGGER == ==
  DEBUG:project:Debug!
  INFO:project:Info!
  WARNING:project:Warning!
  ERROR:project:Error!
  
  ... (normal server stuff)
  </code></pre>
  
  <p>And <strong>django.log</strong> displays:  </p>
  
  <pre><code>DEBUG (0.000) SET SQL_AUTO_IS_NULL = 0; args=None
  DEBUG (0.000) SET SQL_AUTO_IS_NULL = 0; args=None
  DEBUG (0.001) SHOW FULL TABLES; args=None
  DEBUG (0.000) SELECT `django_migrations`.`app`, `django_migrations`.`name` FROM `django_migrations`; args=()
  </code></pre>
  
  <p>But all other logs remain blank.</p>
  
  <h2>Here is my project app</h2>
  
  <p><strong>__init__.py</strong>  </p>
  
  <pre><code>import logging
  
  #logging.error('== == START LOGGER == ==')
  logr = logging.getLogger('project')
  #logr.setLevel('DEBUG')
  
  logr.debug('Debug!')
  logr.info('Info!')
  logr.warning('Warning!')
  logr.error('Error!')
  </code></pre>
  
  <h2>Here are my LOGGING settings</h2>
  
  <p><strong>settings.py</strong>  </p>
  
  <pre><code>LOGGING = {
      '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'
          },
          'simpler': {
              'format': '%(message)s'
          },
      },
      'filters': {
          'require_debug_true': {
              '()': 'django.utils.log.RequireDebugTrue',
          },
      },
      'handlers': {
          'default':{
              'level': 'WARNING',
              'class': 'logging.handlers.RotatingFileHandler',
              'filename': 'logs/err.log',
              'maxBytes': 5242880, # 5MB file size
              'encoding': 'utf-8',
              'backupCount': 5,
              'formatter': 'simple',
          },
          'debug':{
              'level': 'DEBUG',
              'class': 'logging.handlers.RotatingFileHandler',
              'filename': 'logs/debug.log',
              'maxBytes': 5242880, # 5MB file size
              'encoding': 'utf-8',
              'backupCount': 5,
              'formatter': 'simple',
          },
          'django':{
              'level': 'DEBUG',
              'class': 'logging.handlers.RotatingFileHandler',
              'filename': 'logs/django.log',
              'maxBytes': 5242880, # 5MB file size
              'encoding': 'utf-8',
              'backupCount': 5,
              'formatter': 'simple',
          },
          'mail':{
              'level': 'WARNING',
              'class': 'logging.handlers.RotatingFileHandler',
              'filename': 'logs/mail.log',
              'maxBytes': 5242880, # 5MB file size
              'encoding': 'utf-8',
              'backupCount': 5,
              'formatter': 'simple',
          },
          'console': {
              'level': 'DEBUG',
              'filters': ['require_debug_true'],
              'class': 'logging.StreamHandler',
              'formatter': 'simpler',
          },
      },
      'loggers': {
          'django': {
              'handlers': ['django'],
              'level': 'DEBUG',
              'propagate': False,
          },
          'django.db.backends': {
              'handlers': ['django'],
              'level': 'DEBUG',
              'propagate': False,
          },
          'django.request': {
              'handlers': ['mail'],
              'level': 'DEBUG',
              'propagate': False,
          },
          'project': {
              'handlers': ['default', 'debug', 'console'],
              'level': 'DEBUG',
              'propagate': False,
          },
      },
  }
  </code></pre>
  
  <p>Why does it show <code>DEBUG</code> and <code>INFO</code> when I write <code>logging.error('== == START LOGGER == ==')</code> and <code>logr.setLevel('DEBUG')</code> ?? Why don't the log files get written to? I've searched through similar questions and their answers for hours with no success. Thanks.</p>
  
  <p>Edit: Things I've tried:</p>
  
  <p>Changing <code>'disable_existing_loggers'</code> to <code>False</code></p>
  
  <p>Changing <code>'level': 'DEBUG',</code> to <code>'level': 'NOTSET',</code> and <code>'level': 'ERROR',</code></p>
  
  <p>Removing all but necessary settings</p>
  
  <p>Changing <code>'propagate'</code> to <code>True</code></p>
  
  <p>Removing <code>'console'</code> from <code>'handlers'</code> (which does absolutely nothing)</p>