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/22 00:45:43 UTC
[jira] [Created] (SAMZA-60) Specify log directory as a Java
property for Log4j
Chris Riccomini created SAMZA-60:
------------------------------------
Summary: 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
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)