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 Steve Loughran <st...@apache.org> on 2011/09/01 11:53:05 UTC

Re: Turn off all Hadoop logs?

On 29/08/11 20:31, Frank Astier wrote:
> Is it possible to turn off all the Hadoop logs simultaneously? In my unit tests, I don’t want to see the myriad “INFO” logs spewed out by various Hadoop components. I’m using:
>
>    ((Log4JLogger) DataNode.LOG).getLogger().setLevel(Level.OFF);
>      ((Log4JLogger) LeaseManager.LOG).getLogger().setLevel(Level.OFF);
>      ((Log4JLogger) FSNamesystem.LOG).getLogger().setLevel(Level.OFF);
>      ((Log4JLogger) DFSClient.LOG).getLogger().setLevel(Level.OFF);
>      ((Log4JLogger) Storage.LOG).getLogger().setLevel(Level.OFF);
>
> But I’m still missing some loggers...
>

you need a log4j.properties file on the CP that doesn't log so much. I 
do this by

  -removing /logj4.properties from the Hadoop jars in our (private) jar 
repository
  -having custom log4.properties files in the test/ source trees

You could also start junit with the right log4j properties to point it 
at a custom log4j file. I forget what that property is.