Gunicorn giving syntax error for my configuration file
<p>my config file </p>

<pre><code>[loggers]
keys=root, gunicorn.error, gunicorn.access

[handlers]
keys=console, error_file, access_file

[formatters]
keys=generic, access

[logger_root]
level=INFO
handlers=console

[logger_gunicorn.error]
level=INFO
handlers=error_file
propagate=1
qualname=gunicorn.error

[logger_gunicorn.access]
level=INFO
handlers=access_file
propagate=0
qualname=gunicorn.access

[handler_console]
class=StreamHandler
formatter=generic
args=(sys.stdout, )

[handler_error_file]
class=logging.FileHandler
formatter=generic
args=('/tmp/gunicorn.error.log',)

[handler_access_file]
class=logging.FileHandler
formatter=access
args=('/tmp/gunicorn.access.log',)

[formatter_generic]
format=%(asctime)s [%(process)d] [%(levelname)s] %(message)s
datefmt=%Y-%m-%d %H:%M:%S
class=logging.Formatter

[formatter_access]
format=%(message)s
class=logging.Formatter
</code></pre>

<p>My command to execute </p>

<pre><code>gunicorn --env DJANGO_SETTINGS_MODULE=myproject.settings myproject.wsgi --log-level debug --log-file=- -c file:gunicorn_log.conf
</code></pre>

<p>Getting this error </p>

<pre><code>Failed to read config file: gunicorn_log.conf
Traceback (most recent call last):
  File "/home/jameel/django-env/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 93, in get_config_from_filename
    execfile_(filename, cfg, cfg)
  File "/home/jameel/django-env/local/lib/python2.7/site-packages/gunicorn/_compat.py", line 91, in execfile_
    return execfile(fname, *args)
  File "gunicorn_log.conf", line 27
    class=StreamHandler
         ^
SyntaxError: invalid syntax
</code></pre>

<p>I was followed as per their example in github <a href="https://github.com/benoitc/gunicorn/blob/master/examples/logging.conf" rel="nofollow">link</a></p>

<p>Gunicorn config file looks like this: <a href="https://github.com/benoitc/gunicorn/blob/master/examples/example_config.py" rel="nofollow">https://github.com/benoitc/gunicorn/blob/master/examples/example_config.py</a></p>

<p>Your file is a logger configuration file.</p>

<p>Logger configuration is passed by <a href="http://docs.gunicorn.org/en/latest/settings.html#logconfig" rel="nofollow">--log-config</a> parameter.</p>

python django logging celery gunicorn