[
https://issues.apache.org/jira/browse/SAMZA-60?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chris Riccomini updated SAMZA-60:
---------------------------------
Attachment: SAMZA-60.0.patch
Attaching a patch.
* Setting Java system properties in run-class.sh for both log directory and
container name.
* We weren't setting a container name for the AM, but we are now.
* Removed duplicate YarnConfig environment variables. Unified with
ShellCommandBuilder's environment variables.
* Changed SamzaContainer-%d to samza-container-%d for Samza container name
environment variable. Stylistic choice. Makes logs look better.
I opted against including SAMZA_JOB_NAME in favor of SAMZA_CONTAINER_NAME,
which is the container name assigned by Samza (not to be confused with the YARN
container name).
https://reviews.apache.org/r/15104/
> Specify log directory as a Java property for Log4j
> --------------------------------------------------
>
> Key: SAMZA-60
> URL: https://issues.apache.org/jira/browse/SAMZA-60
> Project: Samza
> Issue Type: Bug
> Components: container, yarn
> Affects Versions: 0.6.0
> Reporter: Chris Riccomini
> Assignee: Chris Riccomini
> Attachments: SAMZA-60.0.patch
>
>
> We currently specify SAMZA_LOG_DIR as an environment variable when starting
> Samza's YARN AM, and also when starting a Samza container with YARN.
> It'd be nice to expose the Samza job's name as an environment variable, as
> well: SAMZA_JOB_NAME.
> It'd also be nice to use these variables in log4j.xml (for example), so we
> can have a file-based appender. Unfortunately, it appears that Log4j wants
> Java system properties, not environment variables.
> Let's update run-class.sh to append new Java system properties to SAMZA_OPTS:
> {noformat}
> SAMZA_OPTS="$SAMZA_OPTS -Dsamza.log.dir=$SAMZA_LOG_DIR
> -Dsamza.job.name=$SAMZA_JOB_NAME"
> {noformat}
> Then, in log4j.xml, we should be able to set a file appender:
> {noformat}
> <appender name = "samzaAppender"
> class="org.apache.log4j.RollingFileAppender">
> ...
> <param name="file" value="${samza.log.dir}/${samza.job.name}.log" />
> ...
> </appender>
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.1#6144)