samza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yan Fang" <yanfangw...@163.com>
Subject Re:Re:Need help in log4j.xml externalization
Date Tue, 27 Oct 2015 06:16:14 GMT
" When I keep my log4j.xml in //$PWD/deploy/alice/config/log4j.xml and do not set any "samza.container.name"
then it is not generating any log files for me. "


== this is weird. The run-am/run-container script should automatically create the samba.container.name
if it is not set...











At 2015-10-26 19:57:52, "Patni, Ankush" <Ankush.Patni@altisource.com> wrote:
>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 ${samza.container.name}.
>
>When I keep my log4j.xml in //$PWD/deploy/alice/config/log4j.xml  and do not set any "samza.container.name"
 then it is not generating any log files for me.
>
>But when I set something export JAVA_OPTS="-Dsamza.container.name=samza-application-master-task1"
 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="http://jakarta.apache.org/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}/${samza.container.name}.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" />
>              </layout>
>       </appender>
>
>       <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" />
>              </layout>
>       </appender>
>
>       <root>
>              <priority value="INFO" />
>              <appender-ref ref="File" />
>              <appender-ref ref="RollingAppender" />
>              <appender-ref ref="jmx" />
>       </root>
></log4j:configuration>
>
>Regards,
>Ankush
>***********************************************************************************************************************
>
>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.
>***********************************************************************************************************************
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message