[ 
https://issues.apache.org/jira/browse/SPARK-8981?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14622666#comment-14622666
 ] 

Paweł Kopiczko edited comment on SPARK-8981 at 7/10/15 6:04 PM:
----------------------------------------------------------------

Sure. I believe that when executor is spawned it has access to {{appName}} and 
{{applicationId}} properties of `SparkContext` instance. I'd like it to put 
these values in MDC 
https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/MDC.html#put(java.lang.String,
 java.lang.Object). Having those values in MDC and setting %X\{appName\} and 
%X\{applicationId\} in log4j's PatternLayout would allow filtering out specific 
application logs from a single file. Does that make sense?


was (Author: kopiczko):
Sure. I believe that when executor is spawned it has access to appName and 
applicationId properties of `SparkContext` instance. I'd like it to put these 
values in MDC 
https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/MDC.html#put(java.lang.String,
 java.lang.Object). Having those values in MDC and setting %X{appName} and 
%X{applicationId} in log4j's PatternLayout would allow filtering out specific 
application logs from a single file. Does that make sense?

> Set applicationId and appName in log4j MDC
> ------------------------------------------
>
>                 Key: SPARK-8981
>                 URL: https://issues.apache.org/jira/browse/SPARK-8981
>             Project: Spark
>          Issue Type: New Feature
>            Reporter: Paweł Kopiczko
>            Priority: Minor
>
> It would be nice to have, because it's good to have logs in one file when 
> using log agents (like logentires) in standalone mode. Also allows 
> configuring rolling file appender without a mess when multiple applications 
> are running.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to