igreenfield commented on pull request #26624:
URL: https://github.com/apache/spark/pull/26624#issuecomment-619976944


   log4j.appender.console.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss} %p 
[%X{appId}] [%X{appName}] %c{3} - %m%n
   ```
   properties.asScala.filter(_._1.startsWith("mdc.")).foreach { item =>
         val key = item._1.substring(4)
         org.slf4j.MDC.put(key, item._2)
       }
   ```
   
   in that code you iterate over the properties and add each property that 
start with mdc it adds to MDC so you can use.
   
   we are using spark under spark server so we have long-running sessions and 
many tasks in it that do not connect to each other. and we add properties so we 
can see in the logs which connected to which.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to