python - Gunicorn giving syntax error for my configuration file -
my config file
[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
my command execute
gunicorn --env django_settings_module=myproject.settings myproject.wsgi --log-level debug --log-file=- -c file:gunicorn_log.conf
getting error
failed 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
i followed per example in github link
gunicorn config file looks this: https://github.com/benoitc/gunicorn/blob/master/examples/example_config.py
your file logger configuration file.
logger configuration passed --log-config parameter.
Comments
Post a Comment