How to define .LOGGING settings so that gunicorn finds the right version?

I am trying to start Gunicorn and I am encountering an error (inserted below). At present, it looks like Gunicorn or one of its dependencies is trying to read the settings. LOGGING, and the settings.py file does not define parameters. LOGGING.

So, I would like to know what kind of literal or other code I can add so that the dependencies on Guicorn + match what they think they need.

Code insertion:

(socialenv) jonathan @ li393-189 : ~ / directory $ python manage.py run_gunicorn 0.0.0.
0: 8000
2013-04-14 17:40:13 [26464] [INFO] Starting gunicorn 0.17.2
2013-04-14 17:40:13 [26464] [INFO] Listening at: http://0.0.0.0:8000 (26464)
2013-04-14 17:40:13 [26464] [INFO] Using worker: sync
2013-04-14 17:40:13 [26469] [INFO] Booting worker with pid: 26469
2013-04-14 17:40:13 [26469] [ERROR] Exception in worker process:
Traceback (most recent call last):
  File "/home/jonathan/socialenv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 485, in spawn_worker
    worker.init_process ()
  File "/home/jonathan/socialenv/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 100, in init_process
    self.wsgi = self.app.wsgi ()
  File "/home/jonathan/socialenv/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 103, in wsgi
    self.callable = self.load ()
  File "/home/jonathan/socialenv/local/lib/python2.7/site-packages/gunicorn/app/djangoapp.py", line 133, in load
    return mod.make_command_wsgi_application (self.admin_media_path)
  File "/home/jonathan/socialenv/local/lib/python2.7/site-packages/gunicorn/app/django_wsgi.py", line 113, in make_command_wsgi_application
    reload_django_settings ()
  File "/home/jonathan/socialenv/local/lib/python2.7/site-packages/gunicorn/app/django_wsgi.py", line 109, in reload_django_settings
    logging_config_func (settings.LOGGING)
  File "/usr/lib/python2.7/logging/config.py", line 777, in dictConfig
    dictConfigClass (config) .configure ()
  File "/usr/lib/python2.7/logging/config.py", line 503, in configure
    raise ValueError ("dictionary doesn't specify a version")
ValueError: dictionary doesn't specify a version
Traceback (most recent call last):
  File "/home/jonathan/socialenv/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 485, in spawn_worker
    worker.init_process ()
  File "/home/jonathan/socialenv/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 100, in init_process
    self.wsgi = self.app.wsgi ()
  File "/home/jonathan/socialenv/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 103, in wsgi
    self.callable = self.load ()
  File "/home/jonathan/socialenv/local/lib/python2.7/site-packages/gunicorn/app/djangoapp.py", line 133, in load
    return mod.make_command_wsgi_application (self.admin_media_path)
  File "/home/jonathan/socialenv/local/lib/python2.7/site-packages/gunicorn/app/django_wsgi.py", line 113, in make_command_wsgi_application
    reload_django_settings ()
  File "/home/jonathan/socialenv/local/lib/python2.7/site-packages/gunicorn/app/django_wsgi.py", line 109, in reload_django_settings
    logging_config_func (settings.LOGGING)
  File "/usr/lib/python2.7/logging/config.py", line 777, in dictConfig
    dictConfigClass (config) .configure ()
  File "/usr/lib/python2.7/logging/config.py", line 503, in configure
    raise ValueError ("dictionary doesn't specify a version")
ValueError: dictionary doesn't specify a version
2013-04-14 17:40:13 [26469] [INFO] Worker exiting (pid: 26469)
2013-04-14 17:40:13 [26464] [INFO] Shutting down: Master
2013-04-14 17:40:13 [26464] [INFO] Reason: Worker failed to boot.
(socialenv) jonathan @ li393-189 : ~ / directory $ 
+5
source share
3 answers

, , ,

https://docs.djangoproject.com/en/dev/topics/logging/

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'
        },
    },
    'handlers': {
        'null': {
            'level': 'DEBUG',
            'class': 'logging.NullHandler',
        },
        'console':{
            'level': 'DEBUG',
            'class': 'logging.StreamHandler',
            'formatter': 'simple'
        },
        'mail_admins': {
            'level': 'ERROR',
            'class': 'django.utils.log.AdminEmailHandler',
            'filters': [],
        }
    },
    'loggers': {
        'django': {
            'handlers': ['null'],
            'propagate': True,
            'level': 'INFO',
        },
        'django.request': {
            'handlers': ['mail_admins'],
            'level': 'ERROR',
            'propagate': False,
        },
    }
}
+12

- settings.py:

LOGGING = {
    'version': 1,
}
+9

The error message means that the configuration dictionary passed for the registration configuration does not have a version of the schema. You will need to show your vocabulary to be sure, but this is certainly what we are talking about. See docs for more details .

+1
source