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
- enables both human and computer readable logs, [recommended as a "best practice" by Splunk](https://dev.splunk.com/enterprise/docs/developapps/addsupport/logging/loggingbestpractices/)
33
36
- formats all first and third party logs, you never have to worry about a library using a different logging format
34
37
- simple to integrate into any existing application, requires no changes to existing log statements i.e. [structlog](https://github.com/hynek/structlog)
35
38
36
-
##Install
39
+
# Install
37
40
38
41
```sh
39
42
$ pip install logfmter
40
43
```
41
44
42
-
##Usage
45
+
# Usage
43
46
44
47
This package exposes a single `Logfmter` class that can be integrated into
45
48
the [standard library logging system](https://docs.python.org/3/howto/logging.html) like any [`logging.Formatter`](https://docs.python.org/3/howto/logging.html#formatters).
Using logfmter via fileConfig is not supported, because fileConfig does not support custom formatter initialization. There may be some hacks to make this work in the future. Let me know if you have ideas or really need this.
This will cause all logs to have the `trace_id=123` pair regardless of including
231
234
`trace_id` in keys or manually adding `trace_id` to the `extra` parameter or the `msg` object.
232
235
233
-
##Development
236
+
# Development
234
237
235
-
###Required Software
238
+
## Required Software
236
239
237
240
If you are using [nix](https://zero-to-nix.com/start/install/) & [direnv](https://direnv.net/docs/installation.html), then your dev environment will be managed automatically. Otherwise, you will need to manually install the following software:
0 commit comments