Skip to content

Commit 40855ad

Browse files
author
Bob Bui
committed
Fix #57 and #56
1 parent 8fa8f23 commit 40855ad

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/).
55
The format is based on [Keep a Changelog](http://keepachangelog.com/).
66

7+
## 1.2.7 - 2020-08-27
8+
- Fix #57
9+
710
## 1.2.6 - 2020-08-05
811
- Fix condition for checking root logger handlers #53
912

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ Extra property can be added to logging statement as follow:
180180
logger.info("test log statement", extra = {'props' : {'extra_property' : 'extra_value'}})
181181
```
182182
## 2.5 Root logger
183-
If you want to use root logger as main logger to emit log. Made sure you call **config_root_logger()** after initialize root logger (by logging.basicConfig() or logging.getLogger('root')) [\[2\]](#2-python-logging-propagate)
183+
If you want to use root logger as main logger to emit log. Made sure you call **config_root_logger()** after initialize root logger (by logging.basicConfig() or logging.getLogger()) [\[2\]](#2-python-logging-propagate)
184184
```python
185185
logging.basicConfig()
186186
json_logging.init_<framework name >()

json_logging/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ def config_root_logger():
7878
You must call this if you are using root logger.
7979
Make all root logger' handlers produce JSON format
8080
& remove duplicate handlers for request instrumentation logging.
81-
Please made sure that you call this after you called "logging.basicConfig() or logging.getLogger('root')
81+
Please made sure that you call this after you called "logging.basicConfig() or logging.getLogger()
8282
"""
8383

8484
if not logging.root.handlers:
8585
_logger.error(
8686
"No logging handlers found for root logger. Please made sure that you call this after you called "
87-
"logging.basicConfig() or logging.getLogger('root')")
87+
"logging.basicConfig() or logging.getLogger()")
8888
return
8989

9090
if ENABLE_JSON_LOGGING:
@@ -105,7 +105,7 @@ def __init(framework_name=None, custom_formatter=None, enable_json=False):
105105
106106
If **custom_formatter** is passed, it will (in non-web context) use this formatter over the default.
107107
108-
:param framework_name: type of framework logging should support.
108+
:param framework_name: type of framework logging should support.DEFAULT_CORRELATION_ID_HEADERS
109109
:param custom_formatter: formatter to override default JSONLogFormatter.
110110
"""
111111

@@ -141,7 +141,7 @@ def __init(framework_name=None, custom_formatter=None, enable_json=False):
141141

142142
if not enable_json and not ENABLE_JSON_LOGGING:
143143
_logger.warning(
144-
"JSON format is not enable, normal log will be in plain text but request logging still in JSON format! "
144+
"JSON format is not enabled, normal log will be in plain text but request logging still in JSON format! "
145145
"To enable set ENABLE_JSON_LOGGING env var to either one of following values: ['true', '1', 'y', 'yes']")
146146
else:
147147
ENABLE_JSON_LOGGING = True

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
setup(
1414
name="json-logging",
15-
version='1.2.6',
15+
version='1.2.7',
1616
packages=find_packages(exclude=['contrib', 'docs', 'tests*', 'example', 'dist', 'build']),
1717
license='Apache License 2.0',
1818
description="JSON Python Logging",

0 commit comments

Comments
 (0)