[logback-dev] [JIRA] Created: (LBCLASSIC-249) Logging Exceptions using DBAppender fails (at least on Oracle), when message or stack frame is longer than 254 bytes

Andreas Zielke (JIRA) noreply-jira at qos.ch
Wed Feb 9 13:37:51 CET 2011


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

                 Key: LBCLASSIC-249
                 URL: http://jira.qos.ch/browse/LBCLASSIC-249
             Project: logback-classic
          Issue Type: Bug
          Components: appender
    Affects Versions: 0.9.28
         Environment: Oracle DBMS
            Reporter: Andreas Zielke
            Assignee: Logback dev list
            Priority: Minor


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).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       


More information about the logback-dev mailing list