Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-4392

Easier customization of log messages in Logging[In|Out]Interceptor

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.1
    • Fix Version/s: 2.6.2, 2.7
    • Component/s: Core
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      We're using LoggingInInterceptor and LoggingOutInterceptor to produce logs for use in debugging issues in our services.

      Although we're very happy with the features they provide, we find it a bit difficult to tweak what information is being logged and the format of the log.

      Some of our clients would like more or less info to be logged, some would like everything in one line, wrapped in XML.

      Specifically, it would be nice if the code fragment in the LoggingInInterceptor.logging() and LoggingOutInterceptor.LogWriter.close() methods which produces the log message string was extracted to separate overridable methods in Logging[In|Out]Interceptor, like this:

      protected String formatMessage(LoggingMessage message) {
      // Use toString as default:
      return message.toString();
      }

      Another option is to add a factory method for the LoggingMessage such that we could override the toString method.

      Or perhaps there are even better ways to meet the need of customized logging formats?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ffang Freeman Yue Fang
                Reporter:
                torand Tore Eide Andersen
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: