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 John Clarke <cl...@gmail.com> on 2009/08/07 18:10:06 UTC

changing logging

Hi,

I am using Hadoop 0.18.3. I'm trying to get my app to output DEBUG messages
to the console using a custom conversion pattern.

I'm editing the log4j.properties file in the conf folder but the changes
don't seem to work. All the log messages are still INFO and higher and the
pattern is not changing either.

I'm currently running as a local Java app in Eclipse rather than in Hadoop.

Any ideas?

Cheers,
John

Re: changing logging

Posted by John Clarke <cl...@gmail.com>.
I discoved that my changes to the log4j file DID take effect when I ran the
app in Hadoop. I was expecting the Eclipse plugin to use the Hadoop log4j
file even when the program was run as a standalone Java application but it
was not!  I added a log4j properties file to the classpath and my logging is
now working for both instances.

Thanks for all the help :)



2009/8/11 Steve Loughran <st...@apache.org>

> John Clarke wrote:
>
>> Thanks for the reply. I considered that but I have a lot of threads in my
>> application and it's v handy to have log4j output the thread name with the
>> log message.
>>
>> It's like the log4j.properties file in the conf/ directory is not being
>> used
>> as any changes I make seem to have no effect!
>>
>
> Make sure there isn't a log4j. properties file in any JAR you are using; it
> will get picked up first.
> You can use Ant's <whichresource> task to find this out for you; give it
> the classpath you are using and it will set a property to the first instance
> of the resource that the classloader finds
>
>

Re: changing logging

Posted by Steve Loughran <st...@apache.org>.
John Clarke wrote:
> Thanks for the reply. I considered that but I have a lot of threads in my
> application and it's v handy to have log4j output the thread name with the
> log message.
> 
> It's like the log4j.properties file in the conf/ directory is not being used
> as any changes I make seem to have no effect!

Make sure there isn't a log4j. properties file in any JAR you are using; 
it will get picked up first.
You can use Ant's <whichresource> task to find this out for you; give it 
the classpath you are using and it will set a property to the first 
instance of the resource that the classloader finds


Re: changing logging

Posted by John Clarke <cl...@gmail.com>.
Thanks for the reply. I considered that but I have a lot of threads in my
application and it's v handy to have log4j output the thread name with the
log message.

It's like the log4j.properties file in the conf/ directory is not being used
as any changes I make seem to have no effect!




2009/8/8 bharath vissapragada <bh...@gmail.com>

> Print Statements worked out in my case ,,, Dunno whether that approach is
> right or not .. but it works fine ..
>
>
> On Fri, Aug 7, 2009 at 9:40 PM, John Clarke <cl...@gmail.com> wrote:
>
> > Hi,
> >
> > I am using Hadoop 0.18.3. I'm trying to get my app to output DEBUG
> messages
> > to the console using a custom conversion pattern.
> >
> > I'm editing the log4j.properties file in the conf folder but the changes
> > don't seem to work. All the log messages are still INFO and higher and
> the
> > pattern is not changing either.
> >
> > I'm currently running as a local Java app in Eclipse rather than in
> Hadoop.
> >
> > Any ideas?
> >
> > Cheers,
> > John
> >
>

Re: changing logging

Posted by bharath vissapragada <bh...@gmail.com>.
Print Statements worked out in my case ,,, Dunno whether that approach is
right or not .. but it works fine ..


On Fri, Aug 7, 2009 at 9:40 PM, John Clarke <cl...@gmail.com> wrote:

> Hi,
>
> I am using Hadoop 0.18.3. I'm trying to get my app to output DEBUG messages
> to the console using a custom conversion pattern.
>
> I'm editing the log4j.properties file in the conf folder but the changes
> don't seem to work. All the log messages are still INFO and higher and the
> pattern is not changing either.
>
> I'm currently running as a local Java app in Eclipse rather than in Hadoop.
>
> Any ideas?
>
> Cheers,
> John
>