Merge pull request #724 from suoning/doc-logger

update logging doc
This commit is contained in:
Raphael Deem 2017-05-16 21:10:57 -07:00 committed by GitHub
commit 87c2a5bc97

View File

@ -14,7 +14,7 @@ from sanic.config import LOGGING
# The default logging handlers are ['accessStream', 'errorStream']
# but we change it to use other handlers here for demo purpose
LOGGING['loggers']['network']['handlers'] = [
'accessTimedRotatingFile', 'errorTimedRotationgFile']
'accessSysLog', 'errorSysLog']
app = Sanic('test')
@ -26,8 +26,6 @@ if __name__ == "__main__":
app.run(log_config=LOGGING)
```
After the program starts, it will log down all the information/requests in access.log and error.log in your working directory.
And to close logging, simply assign log_config=None:
```python