title: AWS Elastic Beanstalk logging with python (django)
body: <p>How do you manage your application logs in AWS elastic beanstalk? Which file you write you application logs to?</p>
  <p>I'm using the following Logging configuration in my development environment but this doesn't work when I deploy in AWS.</p>
  <pre><code>DEBUG_LOG_DIR = BASE_DIR + &quot;/django_debug.log&quot;
  LOGGING = {
      'version': 1,
      'disable_existing_loggers': True,
      # How to format the output
      'formatters': {
          'standard': {
              'format' : &quot;[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s&quot;,
              'datefmt' : &quot;%d/%b/%Y %H:%M:%S&quot;
          },
      },
      # Log handlers (where to go)
      'handlers': {
          'null': {
              'level':'DEBUG',
              'class':'django.utils.log.NullHandler',
          },
          'log_file': {
              'level':'DEBUG',
              'class':'logging.handlers.RotatingFileHandler',
              'filename': DEBUG_LOG_DIR,
              'maxBytes': 50000,
              'backupCount': 2,
              'formatter': 'standard',
          },
          'console':{
              'level':'INFO',
              'class':'logging.StreamHandler',
              'formatter': 'standard'
          },
          'mail_admins': {
              'level': 'ERROR',
              'class': 'django.utils.log.AdminEmailHandler',
          },
      },
      # Loggers (where does the log come from)
      'loggers': {
          'repackager': {
              'handlers': ['console', 'log_file'],
              'level': 'DEBUG',
              'propagate': True,
          },
          'django': {
              'handlers':['console'],
              'propagate': True,
              'level':'WARN',
          },
          'django.db.backends': {
              'handlers': ['console', 'log_file'],
              'level': 'WARN',
              'propagate': False,
          },
          '': {
              'handlers': ['console', 'log_file'],
              'level': 'DEBUG',
          },
      }
  }
  </code></pre>