Uvicorn: Support a gunicorn-like config file

Created on 2 Oct 2019  路  7Comments  路  Source: encode/uvicorn

Hi all,

just few question:

  • is there a way to pass a config.py like in gunicorn?
  • how can I override logging in uvicorn?

    • in gunicorn I can pass a custom logging dictionary with my custom formatters, etc...

Thanks!

All 7 comments

We don't currently support a config file, no.
If you're running uvicorn programmatically, then we do have a lower-level interface that allows passing a Config() instance, but it needs documenting.
You'll need to use Python's standard logging module for configuring the logging display (yup it'd be helpful for us to document this too)

Hi @tomchristie thanks! I was able to pass my logger into Config(). A configuration (python) file would be also very helpful.

@madkote Good call. Retitled this to reflect that part of the issue specifically.

There is a related PR https://github.com/encode/uvicorn/pull/323 about reading config from a file, though it is not gunicorn-like.

Let's close this in favor of #323 - we can tackle details of how a config file should look/work once we get to that point.

Having taken a look at this. Yes. And yes, let's make it gunicorn-like - they get it right.

323 is almost there, just needs a tweak.

Closing as a duplicate of #322

Was this page helpful?
0 / 5 - 0 ratings