samza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patni, Ankush" <>
Subject Re:Need help in log4j.xml externalization
Date Mon, 26 Oct 2015 11:57:52 GMT
Hi Yang,

Thanks a lot for help. I have couple of doubts and want to clear them :

I am starting  samza task from same machine where it is running.
My problem is : I am not using StreamAppender as suggested by you in previous reply. But still
DailyRollingFileAppender uses the ${}.

When I keep my log4j.xml in //$PWD/deploy/alice/config/log4j.xml  and do not set any ""
 then it is not generating any log files for me.

But when I set something export JAVA_OPTS=""
 then it generate the desired file in given location : =${samza.log.dir}

Also when my log4j.xml is in my jar then everything run fine, log files are getting generated
within corresponding container. So is there any way I can generate the log files in corresponding
task folders using external log4j and not giving in my jar? There are more than 7 task I am
running from same jar file.

My log4j.xml looks like :

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="">
       <appender name="jmx" class="org.apache.samza.logging.log4j.JmxAppender" />

       <appender name="RollingAppender" class="org.apache.log4j.DailyRollingFileAppender">
              <param name="File" value="${samza.log.dir}/${}.log" />
              <param name="DatePattern" value="'.'yyyy-MM-dd" />
              <layout class="org.apache.log4j.PatternLayout">
                     <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} %c{1}
[%p] %m%n" />

       <appender name="File" class="org.apache.log4j.FileAppender">
              <param name="file" value="${samza.log.dir}/eventpipeline.log" />
              <param name="immediateFlush" value="true" />
              <param name="append" value="false" />
              <layout class="org.apache.log4j.PatternLayout">
                     <param name="conversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} %c{1}
[%p] %m%n" />

              <priority value="INFO" />
              <appender-ref ref="File" />
              <appender-ref ref="RollingAppender" />
              <appender-ref ref="jmx" />


This email message and any attachments are intended solely for the use of the addressee. If
you are not the intended recipient, you are prohibited from reading, disclosing, reproducing,
distributing, disseminating or otherwise using this transmission. If you have received this
message in error, please promptly notify the sender by reply email and immediately delete
this message from your system. This message and any attachments may contain information that
is confidential, privileged or exempt from disclosure. Delivery of this message to any person
other than the intended recipient is not intended to waive any right or privilege. Message
transmission is not guaranteed to be secure or free of software viruses.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message