You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@hadoop.apache.org by Vinod KV <vi...@yahoo-inc.com> on 2010/08/12 13:41:53 UTC
Re: A log4jconfig.xml file
The earlier question is easier to answer given you are loading the file
yourselves :)
You have multiple solutions:
(1) Put it in the lib folder inside the job.jar. It should be
automatically available from the task's classpath.
(2) Set it in distributed cache as a classpath file. See
DistributedCache.addCacheFile(URI uri, Configuration conf).
+vinod
On Thursday 12 August 2010 06:27 AM, Sanjay X. Jain wrote:
> Probably a better question is: In a hadoop job, how can I load my own log4j.properties file instead of the default one?
>
> Thx!
>
>
> On 8/11/10 1:56 PM, "Sanjay Jain"<sa...@yahoo-inc.com> wrote:
>
> I have a log4jconfig.xml file that is loaded in my hadoop job code as: DOMConfigurator.configure("log4jconfig.xml");
> How should I pass this file to the job (and its mapper and reducer)? I have tried to include it in CLASSPATH env variable, and by including the file in job's jar file, both don't seem to work.
> Purpose: want to control what is logged where in my hadoop job's classes/packages.
>
> Any clues will be really helpful.
>
> Thx!
> Sanjay
>
>
>