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: docs/changelog.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
- Allows using values like `ext://sys.stderr` in `fileConfig`/`dictConfig` value fields.
12
12
- Support comma seperated lists for Formatter `fmt` (`style=","`) e.g. `"asctime,message,levelname"`[#15](https://github.com/nhairs/python-json-logger/issues/15)
13
13
- Note that this style is specific to `python-json-logger` and thus care should be taken not to pass this format to other logging Formatter implementations.
14
+
- Supports sequences of strings (e.g. lists and tuples) of field names for Formatter `fmt`. [#16](https://github.com/nhairs/python-json-logger/issues/16)
14
15
15
16
### Changed
16
17
- Rename `pythonjsonlogger.core.LogRecord` and `log_record` arguments to avoid confusion / overlapping with `logging.LogRecord`. [#38](https://github.com/nhairs/python-json-logger/issues/38)
Copy file name to clipboardExpand all lines: docs/quickstart.md
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,10 +45,23 @@ logger.addHandler(logHandler)
45
45
### Output fields
46
46
47
47
#### Required Fields
48
-
You can control the logged fields by setting the `fmt` argument when creating the formatter. By default formatters will follow the same `style` of `fmt` as the `logging` module: `%`, `$`, and `{`. All [`LogRecord` attributes](https://docs.python.org/3/library/logging.html#logrecord-attributes) can be output using their name.
48
+
You can control the logged fields by setting the `fmt` argument when creating the formatter. A variety of different formats are supported including:
49
+
50
+
- Standard library formats: where `style` is one of `%`, `$`, or `{`. This allows using Python JSON Logger Formatters with your existing config.
51
+
- Comma format: where `style` is `,` which simplifies the writing of formats where you can't use more complex formats.
52
+
- A sequence of string: e.g. lists or tuples.
53
+
54
+
All [`LogRecord` attributes](https://docs.python.org/3/library/logging.html#logrecord-attributes) can be output using their name.
0 commit comments