You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Paweł Kopiczko (JIRA)" <ji...@apache.org> on 2015/07/10 20:01:05 UTC

[jira] [Comment Edited] (SPARK-8981) Set applicationId and appName in log4j MDC

    [ 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:00 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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org