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
*[jsonformatter \-\- for python log json](#jsonformatter----for-python-log-json)
5
-
*[Installation](#installation)
6
-
*[Basic Usage](#basic-usage)
7
-
*[Case 1\. Use default config](#case-1-use-default-config)
8
-
*[Case 2\. config in python code](#case-2-config-in-python-code)
9
-
*[Case 3\. config from config file](#case-3-config-from-config-file)
10
-
*[More Usage](#more-usage)
11
-
*[Case 1\. output multiple attributes in one key](#case-1-output-multiple-attributes-in-one-key)
12
-
*[Case 2\. support json\.dumps all optional parameters](#case-2-support-jsondumps-all-optional-parameters)
13
-
*[Case 3\. support cumtom(add/replace) LogRecordattribute](#case-3-support-cumtomaddreplace-logrecord--attribute)
14
-
*[LogRecord Attributes](#logrecord-attributes)
1
+
-[jsonformatter -- for python log json](#jsonformatter----for-python-log-json)
2
+
-[Installation](#installation)
3
+
-[Basic Usage](#basic-usage)
4
+
-[Case 1. Initial root logger like `logging.basicConfig`](#case-1-initial-root-logger-like-loggingbasicconfig)
5
+
-[Case 2. Complete config in python code](#case-2-complete-config-in-python-code)
6
+
-[Case 3. Use config file](#case-3-use-config-file)
7
+
-[Case 4. In `Flask` project, add `LogRecord` attribute for auto output](#case-4-in-flask-project-add-logrecord-attribute-for-auto-output)
8
+
-[Case 5. In `Django` project, config `LOGGING`](#case-5-in-django-project-config-logging)
9
+
-[More Usage](#more-usage)
10
+
-[Case 1. Mix `extra` to output](#case-1-mix-extra-to-output)
11
+
-[Case 2. output multiple attributes in one key](#case-2-output-multiple-attributes-in-one-key)
12
+
-[Case 3. support `json.dumps` all optional parameters](#case-3-support-jsondumps-all-optional-parameters)
13
+
-[Case 4. Solve cumtom`LogRecord`attribute is not `JSON serializable`](#case-4-solve-cumtom-logrecord-attribute-is-not-json-serializable)
14
+
-[LogRecord Attributes](#logrecord-attributes)
15
15
16
16
17
17
18
18
# jsonformatter -- for python log json
19
19
20
-
**jsonformatter** is a formatter for python output json log, you can easily output **LogStash** needed log format or other **custom** json format and you can easily **custom(add/replace)**`LogRecord` attribute.
20
+
**jsonformatter** is a formatter for python output json log, e.g. output **LogStash** needed log.
21
+
22
+
Easily **custom(add/replace)**`LogRecord` attribute, e.g. in `Flask` web project, add `username` attribute to `LogRecord` for auto output username.
23
+
21
24
22
-
**Python 2.7** and **python 3** are supported from version 0.2.X, if you are using a version lower than 0.2.X, **python 3** is only supported.
25
+
26
+
**Python 2.7** and **python 3** are supported from version 0.2.X, if you are using a version lower than 0.2.X, Only **python 3** is supported.
23
27
24
28
25
29
@@ -43,44 +47,34 @@ $ python setup.py install
43
47
44
48
## Basic Usage
45
49
46
-
### Case 1. Use default config
47
-
50
+
### Case 1. Initial root logger like `logging.basicConfig`
0 commit comments