You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ If you're using Cloud Foundry, it might worth to check out the library [SAP/cf-p
30
30
Install by running this command:
31
31
> pip install json-logging
32
32
33
-
By default log will be emitted in normal format to ease the local development. To enable it on production set either **json_logging.ENABLE_JSON_LOGGING** or **ENABLE_JSON_LOGGING environment variable** to true.
33
+
By default log will be emitted in normal format to ease the local development. To enable it on production set enable_json in init_\<framework name\>(enable_json=True) method call (set **json_logging.ENABLE_JSON_LOGGING** or **ENABLE_JSON_LOGGING environment variable** to true is not recommended and will be deprecated in future versions).
34
34
35
35
To configure, call **json_logging.init_< framework_name >()**. Once configured library will try to configure all loggers (existing and newly created) to emit log in JSON format.
36
36
See following use cases for more detail.
@@ -41,8 +41,7 @@ This mode don't support **correlation-id**.
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)
184
183
```python
185
184
logging.basicConfig()
185
+
json_logging.init_<framework name >()
186
186
json_logging.config_root_logger()
187
187
```
188
188
@@ -196,7 +196,6 @@ logging library can be configured by setting the value in json_logging, all conf
196
196
Name | Description | Default value
197
197
--- | --- | ---
198
198
ENABLE_JSON_LOGGING | **DEPRECATED** Whether to enable JSON logging mode.Can be set as an environment variable, enable when set to to either one in following list (case-insensitive) **['true', '1', 'y', 'yes']** , this have no effect on request logger | false
199
-
ENABLE_JSON_LOGGING_DEBUG | Whether to enable debug logging for this library for development purpose. | true
200
199
CORRELATION_ID_HEADERS | List of HTTP headers that will be used to look for correlation-id value. HTTP headers will be searched one by one according to list order| ['X-Correlation-ID','X-Request-ID']
201
200
EMPTY_VALUE | Default value when a logging record property is None | '-'
202
201
CORRELATION_ID_GENERATOR | function to generate unique correlation-id | uuid.uuid1
0 commit comments