Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-493

Logging Exceptions using DBAppender fails (at least on Oracle), when message or stack frame is longer than 254 bytes

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 0.9.28
    • logback-classic
    • None
    • Oracle DBMS

    Description

      Sometimes the DBAppender failed to log Exceptions, so I checked the status of the StatusManager and found the folloging problem:
      java.sql.BatchUpdateException: ORA-12899: Wert zu groß für Spalte "SUBSYSTEMTEST"."LOGGING_EVENT_EXCEPTION"."TRACE_LINE" (aktuell: 692, maximal: 254)

      Possible fix:
      After reading the code of DBAppender I subclassed it and changed the code of the method
      void updateExceptionStatement(PreparedStatement exceptionStatement, String txt, short i, long eventId)
      so that the text would be shortened accordingly.
      This seems to be the most consistent workaround, as many other columns are also only 254 bytes wide.

      I'd much rather have a wider column and not loose information, though. (This would be consistent with the changes to LOGGING_EVENT_EXCEPTION as proposed in LBCLASSIC-170).

      Attachments

        Activity

          People

            logback-dev Logback dev list
            andreas.zielke Andreas Zielke
            Votes:
            5 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: