Browse Source

Update README.md

Co-authored-by: Miri Bar <37478344+mirii1994@users.noreply.github.com>
master
Ral G 1 year ago
committed by GitHub
parent
commit
d71e9d3e43
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      README.md

+ 3
- 1
README.md View File

@ -165,7 +165,9 @@ For example:
logger.info('Warning', extra={'extra_key':'extra_value'})
```
#### Dynamic Extra Fields
The following additional code example offers the same functionlites that availavle with the extra parameter to add additional fields to logs. The difference is that it uses logging filters so it will add the fields that are declared key-values from the extra dictionary to every log that's generated after adding the fliter. You can keep updating the logs with additional filters.
If you prefer, you can add extra fields to your logs dynamically, and not pre-defining them in the configuration.
This way, you can allow different logs to have different extra fields.
See the following code example:
```python
from logzio.handler import ExtraFieldsLogFilter


Loading…
Cancel
Save