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

JUL EcsFormatter boolean parameter values are ignored #133

Closed odonati-fr closed 2 years ago

odonati-fr commented 3 years ago

The boolean parameters values (in co.elastic.logging.jul.EcsFormatter's constructor) are loaded using java method Boolean.getBoolean(property) instead of Boolean.parseBoolean(string).

So if logging.properties contains: co.elastic.logging.jul.EcsFormatter.stackTraceAsArray=true the formatter property stackTraceAsArray will be true only if a system property named "true" with value "true" exists.

It's a workaround but I don't think it was intended that way.

eyalkoren commented 2 years ago

Sorry for the very long wait, we've been very busy 😄

It's a workaround but I don't think it was intended that way.

Definitely not intended this way.

A test for stack-as-array would uncover that. Once #177 is merged, I may include a general test within the fix for this issue.

Thanks for reporting!