Skip to content

Document the JdbcAppender truncateStrings attribute - #4320

Open
dajiaohuang wants to merge 1 commit into
apache:2.xfrom
dajiaohuang:docs/jdbc-truncate-strings
Open

dajiaohuang wants to merge 1 commit into
apache:2.xfrom
dajiaohuang:docs/jdbc-truncate-strings

Conversation

@dajiaohuang

Copy link
Copy Markdown

JdbcAppender.Builder#truncateStrings is a @PluginBuilderAttribute with a default of true, so
it can be configured on the <Jdbc> element. It was the only optional attribute of the appender
that the manual did not document, which makes the attribute undiscoverable even though it changes
what is written to the database: when it is true, values written to string columns are truncated
to the size reported by the database metadata.

This adds the missing row to the attribute table in
src/site/antora/modules/ROOT/pages/manual/appenders/database.adoc, in the same format as the
neighbouring reconnectIntervalMillis row.

Validation: rendered the page with Asciidoctor and confirmed the table still has four columns per
row and that the new row is emitted with the JdbcAppender-attr-truncateStrings anchor, the type
boolean and the default true. The full Antora build was not run locally; it is driven by the
shared apache/logging-parent deploy-site workflow.

Checklist

  • Base your changes on 2.x branch if you are targeting Log4j 2; use main otherwise
  • ./mvnw verify succeeds (the build instructions)
  • Non-trivial changes contain an entry file in the src/changelog/.2.x.x directory
  • Tests are provided

`JdbcAppender.Builder#truncateStrings` is a `@PluginBuilderAttribute` with a
default of `true`, so it can be set on the `<Jdbc>` element, but it was the
only optional attribute of the appender missing from the attribute table in
the manual. Add the missing row.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant