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: CHANGELOG.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
7
7
## [Unreleased]
8
8
9
+
## [0.3.0] - 2022-12-02
10
+
### Added
11
+
- Added `exception_field_name` parameter.
12
+
9
13
## [0.2.1] - 2022-01-26
10
14
### Fixed
11
15
-`datetime`, `time` and `date` instances are now represented following [ISO-8601](https://www.iso.org/iso-8601-date-and-time-format.html) format instead of raising a `TypeError`.
@@ -23,7 +27,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Copy file name to clipboardExpand all lines: README.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,9 @@ This dictionary will contain 3 keys:
40
40
*`message`: The str representation of the exception (usually the provided error message).
41
41
*`stack`: The stack trace, formatted as a string.
42
42
43
+
You can rename the exception field key by setting the `exception_field_name` parameter with a new name for the key.
44
+
It is also possible to disable this behaviour by setting the `exception_field_name` parameter to `None` or an empty string
45
+
43
46
### Logging with a dictionary
44
47
45
48
This formatter allows you to log dictionary as in the following:
@@ -57,7 +60,7 @@ The resulting JSON dictionary will be the one you provided (with the [additional
57
60
Anything not logged using a dictionary will be handled by the standard formatter and it can result in one of the 2 output:
58
61
* A JSON dictionary, if [additional fields](#adding-additional-fields-and-values) are set or if `extra` parameter is used while logging, with the message available in the `msg` key of the resulting JSON dictionary.
59
62
Default `msg` key name can be changed by `message_field_name` parameter of the `logging_json.JSONFormatter` instance.
60
-
* The formatted record, if no [additional fields](#adding-additional-fields-and-values) are set.
63
+
* The formatted record, if no [additional fields](#adding-additional-fields-and-values) are set.
61
64
62
65
This handles the usual string logging as in the following:
0 commit comments