From 730f7c5e41635d5ab7a78102f4c534acab758392 Mon Sep 17 00:00:00 2001 From: Yun Xu Date: Wed, 13 Sep 2017 18:30:38 -0700 Subject: [PATCH] add doc for customizing logging config --- docs/sanic/logging.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/sanic/logging.md b/docs/sanic/logging.md index 286282f0..49805d0e 100644 --- a/docs/sanic/logging.md +++ b/docs/sanic/logging.md @@ -20,6 +20,13 @@ if __name__ == "__main__": app.run(debug=True, access_log=True) ``` +To use your own logging config, simply use `logging.config.dictConfig`, or +pass `log_config` when you initialize `Sanic` app: + +```python +app = Sanic('test', log_config=LOGGING_CONFIG) +``` + And to close logging, simply assign access_log=False: ```python