You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by Michael Bieniosek <mi...@powerset.com> on 2007/06/15 01:14:15 UTC

how do I get SYSLOG and STDOUT to go to the same place?

Hi,

I noticed that HADOOP-975 and HADOOP-1000 made the log4j from child vms go
to a different place than the stdout for the task.  My tasks send some of
their debugging information to stdout, and some of it to log4j.  I'd like
all this information to go to the same place, so that I can see the order in
which things are happening.

In my log4j.properties, I set
log4j.appender.TLA=org.apache.log4j.ConsoleAppender
log4j.appender.TLA.target=System.out

However, this actually sends the output from log4j to SYSLOG in the task
logs.  This is not want I want.

How do I make SYSLOG go to STDOUT instead?  Or, how do I undo
HADOOP-975/HADOOP-1000?

Thanks,
Michael


Re: how do I get SYSLOG and STDOUT to go to the same place?

Posted by Enis Soztutar <en...@gmail.com>.
You may achieve this with some hack.
Basically you should modify TaskRunner#runChild() method, in the call // 
Copy stdout of the child-process via a thread
      logStdOutThread = logStream((t.getTaskId() + " - " + "stdout"),
                                  process.getInputStream(),
                                  taskStdOutLogWriter);


i think you can give the two loggers the same file(stdout, and syslog), 
but due to the buffering in seperate loggers, the file may not end up 
with the same order of logs of the execution.


Michael Bieniosek wrote:
> Hi,
>
> I noticed that HADOOP-975 and HADOOP-1000 made the log4j from child vms go
> to a different place than the stdout for the task.  My tasks send some of
> their debugging information to stdout, and some of it to log4j.  I'd like
> all this information to go to the same place, so that I can see the order in
> which things are happening.
>
> In my log4j.properties, I set
> log4j.appender.TLA=org.apache.log4j.ConsoleAppender
> log4j.appender.TLA.target=System.out
>
> However, this actually sends the output from log4j to SYSLOG in the task
> logs.  This is not want I want.
>
> How do I make SYSLOG go to STDOUT instead?  Or, how do I undo
> HADOOP-975/HADOOP-1000?
>
> Thanks,
> Michael
>
>
>