quarkus-logging-json icon indicating copy to clipboard operation
quarkus-logging-json copied to clipboard

Return value.toString() from KeyValueStructuredArgument.toString()

Open rsassoon opened this issue 3 years ago • 1 comments

When outputting logs locally we would disable json formatting and still would want to see the structured values in the logged message, e.g.,:

log.info("Test log of structured arg with value {}", kv("key", "value"));

Please override toString() in KeyValueStructuredArgument to return value.toString()

rsassoon avatar Oct 21 '21 14:10 rsassoon

There is no good solution when you have disabled the extension.

Only possible solution will be some string formatting, as there is no json generator available and trying to keep this extension small and without too many dependencies. There will be too many opinions on this formatting, I think the best solution will be to extend KeyValueStructuredArgument with your own implementation and use that.

SlyngDK avatar Aug 31 '22 14:08 SlyngDK