@ -26,6 +26,11 @@ In case the logs failed to be sent to Logz.io after a couple of tries, they will
pip install logzio-python-handler
pip install logzio-python-handler
```
```
If you'd like to use [Trace context](https://github.com/logzio/logzio-python-handler#trace-context) then you need to install the OpenTelemetry logging instrumentation dependecy by running the following command:
logger.error("Error test log") # Outputs: {"message":"Error test log","foo":"bar","counter":1,"err_msg":"Failed to run due to exception.","status_code":500}
# If you'd like to remove filters from future logs using the logger.removeFilter option:
To enable this feature, set the `add_context` param in your handler configuration to `True`, like in this example:
To enable this feature, set the `add_context` param in your handler configuration to `True`, like in this example:
```python
```python
@ -255,7 +292,12 @@ LOGGING = {
Please note that if you are using `python 3.8`, it is preferred to use the `logging.config.dictConfig` method, as mentioned in [python's documentation](https://docs.python.org/3/library/logging.config.html#configuration-file-format).
Please note that if you are using `python 3.8`, it is preferred to use the `logging.config.dictConfig` method, as mentioned in [python's documentation](https://docs.python.org/3/library/logging.config.html#configuration-file-format).
## Release Notes
## Release Notes
- 4.1.0
- Add ability to dynamically attach extra fields to the logs.
- Import opentelemetry logging dependency only if trace context is enabled and dependency is installed manually.