Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is log-config-dict broken? #1880

Closed
fubel opened this issue Sep 20, 2018 · 3 comments
Closed

Is log-config-dict broken? #1880

fubel opened this issue Sep 20, 2018 · 3 comments

Comments

@fubel
Copy link

fubel commented Sep 20, 2018

I tried using the workaround described here to pass a json dictconfig

exec gunicorn -b :8080 --log-config-dict "$(jq -c @JSON logging_debug.json)" app

But no matter what dictconfig I store in logging_debug.json, the command fails.

Error: Value is not a dictionary

and then listing the passed dictconfig string. The command also fails on the dictconfig from gunicorn.glogging.CONFIG_DEFAULTS:

Error: Value is not a dictionary "{"disable_existing_loggers":false,"version":1,"handlers":{"console":{"formatter":"generic","stream":"sys.stdout","class":"logging.StreamHandler"},"error_console":{"formatter":"generic","stream":"sys.stderr","class":"logging.StreamHandler"}},"loggers":{"gunicorn.access":{"qualname":"gunicorn.access","level":"INFO","handlers":["console"],"propagate":true},"root":{"level":"INFO","handlers":["console"]},"gunicorn.error":{"qualname":"gunicorn.error","level":"INFO","handlers":["error_console"],"propagate":true}},"formatters":{"generic":{"datefmt":"[%Y-%m-%d %H:%M:%S %z]","class":"logging.Formatter"}}}"

Is there a workaround for this?

@tilgovi
Copy link
Collaborator

tilgovi commented Sep 20, 2018

JSON is not a Python dict literal. I suspect that where you have values like true or null you would need True or None.

@tilgovi
Copy link
Collaborator

tilgovi commented Sep 20, 2018

Oh, i see. That was my recommendation. I was wrong. I'll edit that comment to clarify that this won't always work.

@benoitc
Copy link
Owner

benoitc commented Oct 9, 2018

Closing the issue because no more activity. Feel free to open a new ticket if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants