Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2413

Exceptions are added to all columns when a JDBC Appender's ColumnMapping uses a Pattern

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.11.1
    • 3.0.0, 2.11.2
    • Appenders
    • None

    Description

      I think there is a bug in ColumnMapping build() on creating the Layout from pattern.

      It should also include: .withAlwaysWriteExceptions(false) in there.
      Currently if you add logger.error(e.getMessage(), e) somewhere it will try to insert the stack into every database field if patterns is used to create the ColumnMapping's.

      This comes from the default behaviour of PatternLayout that in case of an excepiton it tryes to add it in the end of every pattern.

      But if you have Multiple columins in your table with JDBCAppender then you probably have other metadata on those fields then the actual exception and you will get an insertion error on most fields because the data is to big.

      Attachments

        Issue Links

          Activity

            People

              ggregory Gary D. Gregory
              mysticel Andres Luuk
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: