samza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yan Fang <yanfang...@gmail.com>
Subject Re: log4j configuration
Date Tue, 04 Aug 2015 21:04:51 GMT
Hi Jordi,

This is a little tricky. :)

1. If you want to specify the logs to specific locations, please use the
following two properties, such as

*task.opts*=-Dsamza.log.dir=/tmp/samza-logs
*yarn.am.opts*=-Dsamza.log.dir=/tmp/samza-master-logs

2. then why doesn't export SAMZA_LOG_DIR work?

Because this setting only takes effect in your host machine. When you
submit the job, AM and containers do not inherit the environment variables
from their host.

3. then why can you still see the gc logs?

Though this variable does not affect AM and containers, it is used by the
YarnClient, which is used to submit the job. So essentially the gc log is
for the YarnClient (it dies after submitting). The log of YarnClient is
taken care by the* /bin/log4j-console.xml* file, not lib/log4j.xml (this
one is for the AM and all containers).

Hope this makes you a little clear.

Thanks,






Fang, Yan
yanfang724@gmail.com

On Tue, Aug 4, 2015 at 12:44 AM, Jordi Blasi Uribarri <jblasi@nextel.es>
wrote:

> Hi,
>
> I guess this is just a howto question, but I am not able to find how it
> works. I am trying to trace the code of the job I want to execute in Samza.
> I have defined the environment variable as stated in the documentation:
> export SAMZA_LOG_DIR=/opt/logs
>
> I believe that this is working as I have seen that the garbage collector
> correctly generates the gc.o file and writes to it. The directories exists
> in all samza servers (two in my lab).
>
> I have added the following code to the job:
>
> Logger logger = Logger.getLogger(GetConfig.class);
> logger.info("Trace text message");
>
> Although the code is being executed (I can see the messages going through)
> I see no trace written. I don’t have experience with log4j and maybe it is
> there where I have to look but, I am missing something?
>
> Thanks,
>
>                 Jordi
> ________________________________
> Jordi Blasi Uribarri
> Área I+D+i
>
> jblasi@nextel.es
> Oficina Bilbao
>
> [http://www.nextel.es/wp-content/uploads/Firma_Nextel_2015.png]
>

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