diff --git a/docs/conf.py b/docs/conf.py index 57c8488..5f8b6b6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -13,7 +13,8 @@ templates_path = [] source_suffix = '.rst' master_doc = 'index' project = 'sprockets.logging' -copyright = '2015, Dave Shawley' +author = 'Dave Shawley' +copyright = '2015, AWeber Communications' version = '.'.join(__version__.split('.')[0:1]) release = __version__ if len(version_info) > 3: @@ -25,4 +26,5 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] intersphinx_mapping = { 'python': ('https://docs.python.org/', None), 'sprockets': ('https://sprockets.readthedocs.org/en/latest/', None), + 'tornado': ('http://www.tornadoweb.org/en/stable/', None), } diff --git a/docs/history.rst b/docs/history.rst index 54a5d64..bec3adf 100644 --- a/docs/history.rst +++ b/docs/history.rst @@ -1,8 +1,21 @@ Version History =============== +`1.1.0`_ Jun 18, 2015 +--------------------- + - Added :class:`sprockets.logging.JSONRequestFormatter` + - Added :method:`sprockets.logging.tornado_log_function` + - Added convenience constants and methods as a pass through to Python's logging package: + - :data:`sprockets.logging.DEBUG` to :data:`logging.DEBUG` + - :data:`sprockets.logging.ERROR` to :data:`logging.ERROR` + - :data:`sprockets.logging.INFO` to :data:`logging.INFO` + - :data:`sprockets.logging.WARN` to :data:`logging.WARN` + - :data:`sprockets.logging.WARNING` to :data:`logging.WARNING` + - :method:`sprockets.logging.dictConfig` to :method:`logging.config.dictConfig` + - :method:`sprockets.logging.getLogger` to :method:`logging.getLogger` `1.0.0`_ Jun 09, 2015 --------------------- - Added :class:`sprockets.logging.ContextFilter` +.. _1.1.0: https://github.com/sprockets/sprockets.logging/compare/1.0.0...1.1.0 .. _1.0.0: https://github.com/sprockets/sprockets.logging/compare/0.0.0...1.0.0 diff --git a/examples/tornado-app.py b/examples/tornado-app.py index d88a852..fb0652d 100644 --- a/examples/tornado-app.py +++ b/examples/tornado-app.py @@ -13,31 +13,30 @@ LOG_CONFIG = { 'class': 'logging.StreamHandler', 'stream': 'ext://sys.stdout', 'formatter': 'simple', - 'filters': ['context'], - }, + 'filters': ['context'] + } }, 'formatters': { 'simple': { - 'class': 'logging.Formatter', - 'format': '%(levelname)s %(name)s: %(message)s [%(context)s]', - }, + '()': sprockets.logging.JSONRequestFormatter + } }, 'filters': { 'context': { '()': 'sprockets.logging.ContextFilter', - 'properties': ['context'], - }, + 'properties': ['context'] + } }, 'loggers': { 'tornado': { - 'level': 'DEBUG', - }, + 'level': 'DEBUG' + } }, 'root': { 'handlers': ['console'], - 'level': 'DEBUG', + 'level': 'DEBUG' }, - 'incremental': False, + 'incremental': False } @@ -69,7 +68,7 @@ if __name__ == '__main__': app = web.Application([ web.url('/(?P\w+)', RequestHandler, kwargs={'parent_log': logger}), - ]) + ], log_function=sprockets.logging.tornado_log_function) app.listen(8000) signal.signal(signal.SIGINT, sig_handler) signal.signal(signal.SIGTERM, sig_handler)