Skip to content

Conversation

@philsttr
Copy link
Collaborator

@philsttr philsttr commented Feb 4, 2023

Add ability to customize the PrettyPrinter used by PrettyPrintingJsonGeneratorDecorator.

Specifically, add rootSeparator and spacesInObjectEntries fields.

Change default root separator used by the PrettyPrinter to an empty string to match the default rootValueSeparator used by the formatters. Previously, the default was a space (" "). So this will slightly change the output when the PrettyPrintingJsonGeneratorDecorator is used. To revert to the old behavior, configure the decorator like this:

<jsonGeneratorDecorator class="net.logstash.logback.decorate.PrettyPrintingJsonGeneratorDecorator">
	<rootSeparator>[SPACE]</rootSeparator>
</jsonGeneratorDecorator>

Requested in discussion #906

Add ability to customize the PrettyPrinter used by PrettyPrintingJsonGeneratorDecorator.

Specifically, add rootSeparator and spacesInObjectEntries fields.

Change default root value separator used by the PrettyPrinter to an empty string to match the default rootValueSeparator used by the formatters.
Previously, the default was a space (" ").  So this will slightly change the output when the PrettyPrintingJsonGeneratorDecorator is used.
To revert to the old behavior, configure the decorator like this:

<jsonGeneratorDecorator class="net.logstash.logback.decorate.PrettyPrintingJsonGeneratorDecorator">
	<rootSeparator>[SPACE]</rootSeparator>
</jsonGeneratorDecorator>

Requested in discussion #906
@philsttr philsttr added type/enhancement warn/api-change Breaking change with compilation or xml configuration errors labels Feb 4, 2023
@philsttr philsttr merged commit c77bb22 into main Feb 4, 2023
@philsttr philsttr deleted the pretty_print_customize branch February 4, 2023 10:14
@philsttr philsttr added warn/behavior-change Breaking change of publicly advertised behavior and removed warn/api-change Breaking change with compilation or xml configuration errors labels Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/enhancement warn/behavior-change Breaking change of publicly advertised behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants