Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to customize the PrettyPrinter #926

Merged
merged 1 commit into from
Feb 4, 2023
Merged

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.

None yet

1 participant