Hi,
If you have an application that adds a key like this to its log:
{"service": {"version": 1.0.0, "name": "myapp", "environment": "dev"}}
Then you end up having service.name be set to None and ultimately be deleted from the output, because of this line:
|
extras["service.name"] = extras.pop("elasticapm_service_name", None) |
Maybe this should instead set service.name to prefer elasticapm_service_name, but fall back to service.name if it already exists and isn't None, i.e.:
extras["service.name"] = extras.pop("elasticapm_service_name", extras.get("service.name", None))
I'm not using Elastic APM and ran into this issue.
Hi,
If you have an application that adds a key like this to its log:
{"service": {"version": 1.0.0, "name": "myapp", "environment": "dev"}}Then you end up having
service.namebe set to None and ultimately be deleted from the output, because of this line:ecs-logging-python/ecs_logging/_stdlib.py
Line 227 in 9f35b52
Maybe this should instead set
service.nameto preferelasticapm_service_name, but fall back toservice.nameif it already exists and isn't None, i.e.:I'm not using Elastic APM and ran into this issue.