Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-6468

Improve Logging of IDoc Errors

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: jboss-fuse-6.3-patches
    • Fix Version/s: fuse-7.0
    • Component/s: Camel
    • Labels:
      None
    • Sprint:
      7.0 Sprint 6

      Description

      Community Member requested this enhancement:

      The logging in IDocUtil could be improved.

      An Exception “Failed to set value” is logged in two positions in Code:
      LOG.warn("Failed to set value", e);
      It would be great for debugging purposes if the exactly field (and the value) is logged.

      Example implementation witch I used during failure analysis:

      public static void setIdocFieldValue(String fieldName, Segment segment, IDocSegment idocSegment)

      { … }

      catch (Exception e)

      { // LOG.warn("Failed to set value", e); logFailedToSetValue(fieldName, segment, idocSegment, e); }

      }

      private static void logFailedToSetValue(String fieldName, Segment segment, IDocSegment idocSegment, Exception e) {
      StringBuilder sb = new StringBuilder();
      try

      { sb.append(idocSegment.getDocument().getMessageType()); sb.append(":"); sb.append(segment.getIdocType()); sb.append("."); sb.append(segment.getDefinition()); }

      catch (Exception ex) {
      } finally

      { sb.append("."); sb.append(fieldName); }

      //TODO: some information about the value itself would also be nice...
      LOG.warn("BF-MODIFICATION: Failed to set value: " + sb.toString(), e);
      }

      This implementation leads to output:
      BF-MODIFICATION: Failed to set value: WMCATO:WMCAID01.E2LTCAH001.SOLEX

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                wcollins William Collins
                Reporter:
                wcollins William Collins
                Tester:
                Jan Bouska
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: