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

Skip SubstituteLogger from caller data

    XMLWordPrintable

Details

    Description

      The following converter (pattern) use CallerData to get the first stack trace element.

      • ClassOfCallerConverter
      • MethodOfCallerConverter
      • LineOfCallerConverter
      • FileOfCallerConverter

      If I want to extend the SubstituteLogger to add utility methods then the first element of the stack will always be SubstituteLogger.

      I think Logback should ignore SubstituteLogger from the stack trace element and take the next element.

      <code>
      for (StackTraceElement stackTraceElement : callerData) {
      if (SubstituteLogger.class.getName().equals(stackTraceElement.getClassName()))

      { continue; }

      return stackTraceElement;
      }
      </code>

      I know that I can create a custom layout or extend PatternLayout to replace the converter but I think Logback should do that by default.

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            ggrossetie Guillaume Grossetie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: