Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-47240 SPIP: Structured Logging Framework for Apache Spark
  3. SPARK-49216

Fix to not log message context with explicitly LogEntry constructed when Structured Logging conf is off

    XMLWordPrintableJSON

Details

    Description

      To use structured logging developers usually do

      logInfo(log"Lost executor ${MDC(LogKeys.EXECUTOR_ID, "1")}."), 

      When the structured logging conf is off, the context is not logged.
      However if explicitly constructing the LogEntry and calling the public API,

      logInfo(
        MessageWithContext(
          "Lost executor 1.",
          new java.util.HashMap[String, String] { put(LogKeys.EXECUTOR_ID.name, "1") }
        )
      ) 

      the conf does not take effect and even when it is off, the context is still logged.

      The behavior should be fixed.

      Attachments

        Issue Links

          Activity

            People

              xyyu Xinyi Yu
              xyyu Xinyi Yu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: