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

The MDC properties are not set to LoggingEvent when logging over the SocketAppender

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.0.13
    • logback-classic
    • None
    • Operating System: Linux
      Platform: PC
      JDK: 1.7

    Description

      If the SocketAppender is the only appender configured in logback.xml, then the mdcPropertyMap field of the LoggingEvent will be set to an empty map and no MDC will arrive on the ServerSocketReceiver side.

      The problem might be that the AbstractSocketAppender uses a BlockingQueue and the logging events are processed on a different thread in which there are no mdc properties.

      However if logback.xml has a ConsoleAppender and a SocketAppender, what happens is that the mdc properties are correctly set to the loggingEvent by the ConsoleAppender and when is passed to the SocketAppender, the logging event is correctly serialized and the mentioned problem does not appear.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            iandrei Andrei I
            Votes:
            7 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated: