elastic / ecs-logging-java

https://www.elastic.co/guide/en/ecs-logging/java/current/intro.html
Apache License 2.0
139 stars 74 forks source link

Add params for others service fields #113

Closed vlaborie closed 3 years ago

vlaborie commented 3 years ago

Ecs-logging-java permit to define the service.name but no others service fields.

Can you add params for service.type and service.version ?

felixbarny commented 3 years ago

You can add arbitrary additional fields. Example for log4j2:

  <KeyValuePair key="service.version" value="1.2.3"/>
vlaborie commented 3 years ago

It is also possible with jul and log4j ?

felixbarny commented 3 years ago

Currently, that's not possible. Would you be interested in contributing support for it?

vlaborie commented 3 years ago

I would, but i am not a Java developer.

Have you any plan to implement this in the near future ?

felixbarny commented 3 years ago

I see what I can do but I can't make promises.

As a workaround, could you just set all the information into service.name?

felixbarny commented 3 years ago

Thank's for adding additional fields to log4j and JUL.

I tested it and it work well for log4j but doesn't work for JUL.

I tried to add co.elastic.logging.jul.EcsFormatter.additionalFields=key1=value1,key2=value2 in my Tomcat logging.properties like specified in documentation but nothing happened

Thanks for reporting. Not sure why you deleted that comment. This should be fixed by #118