You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by "Chris Riccomini (JIRA)" <ji...@apache.org> on 2013/10/31 16:11:17 UTC
[jira] [Resolved] (SAMZA-60) Specify log directory as a Java
property for Log4j
[ https://issues.apache.org/jira/browse/SAMZA-60?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chris Riccomini resolved SAMZA-60.
----------------------------------
Resolution: Fixed
Got a ship it from [~sriramsub] on RB.
Merged and committed.
Also updated docs, and merged hello-samza.
> 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)