You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@nutch.apache.org by Kshitij Shukla <ks...@cisinlabs.com> on 2016/04/13 14:36:35 UTC

[CIS-CMMI-3] Re: [CIS-CMMI-3] Enabling/configuring Nutch logging?

Thanks for your reply Lewis,

Regarding your points:
1) I am already using parameterized messaging convention.
2) I tried adding class explicitly to the log4j.properties.
3) I have rebuild nutch followed by a cluster restart.

Still i am unable to see the output of this line below anywhere in 
console and logs!
LOG.debug("Found keys");

BR.

On Tuesday 12 April 2016 01:42 AM, Lewis John Mcgibbney wrote:
> Hi Kshitij,
>
> On Mon, Apr 11, 2016 at 8:12 AM, <us...@nutch.apache.org> wrote:
>
>> I am working on developing a plugin for nutch. I have added some code to
>> see the output either in console or in logs like this:
>>
>> *LOG.debug("Found keys :" + lcMetatag + "\t" + value);*
>>
> I would advise you to use the parameterized messaging convention for all of
> your logging
> http://www.slf4j.org/faq.html#logging_performance
>
>
>> I have also tried adding these 2 files in log4j.properties (& recompiling
>> nutch):
>>
>> *# RootLogger - DailyRollingFileAppender**
>> **log4j.rootLogger=DEBUG,DRFA**
>> **
>> **log4j.logger.org.apache.nutch=DEBUG**
>>
>
> I would suggest that you explicitly add your class to the log4j.properties
> file, examples of how to do this can be found below
> https://github.com/apache/nutch/blob/trunk/conf/log4j.properties#L26-L61
>
>
>> *
>> But I cannot find the output neither in console nor in hadoop logs.
>>
> Please remember to rebuild your codebase after you change anything, this
> will ensure that new files are packaged into the .job file for submission
> to YARN.
>


-- 

Please let me know if you have any questions , concerns or updates.
Have a great day ahead :)

Thanks and Regards,

Kshitij Shukla
Software developer

*Cyber Infrastructure(CIS)
**/The RightSourcing Specialists with 1250 man years of experience!/*

DISCLAIMER:  INFORMATION PRIVACY is important for us, If you are not the 
intended recipient, you should delete this message and are notified that 
any disclosure, copying or distribution of this message, or taking any 
action based on it, is strictly prohibited by Law.

Please don't print this e-mail unless you really need to.

-- 
 
------------------------------

*Cyber Infrastructure (P) Limited, [CIS] *(CMMI Level 3 Certified)

Central India's largest Technology Company.

*Ensuring your success through our highly optimizedTechnology solutions.*

www.cisin.com | +Cisin <https://plus.google.com/+Cisin/> | Linkedin 
<https://www.linkedin.com/company/cyber-infrastructure-private-limited> | Offices:  
India | USA | Singapore | South Africa.
------------------------------

*** Please note that this message and any attachments may contain 
confidential and proprietary material and information and are intended only 
for the use of the intended recipient(s). If you are not the one, you 
should delete it immediately to avoid any copy write issues. 

Re: [CIS-CMMI-3] Re: [CIS-CMMI-3] Enabling/configuring Nutch logging?

Posted by Lewis John Mcgibbney <le...@gmail.com>.
Hi Kshitij,

On Wed, Apr 13, 2016 at 5:36 AM, Kshitij Shukla <ks...@cisinlabs.com>
wrote:

> Thanks for your reply Lewis,
>
> Regarding your points:
> 1) I am already using parameterized messaging convention.
>

>From your line of Java code... you were not. You posted the following

*LOG.debug("Found keys :" + lcMetatag + "\t" + value);*

Parameterized message notation would be as follows

*LOG.debug("Found keys : {} \t {}", lcMetatag, value);*


2) I tried adding class explicitly to the log4j.properties.
>

So can you paste a snipped of your log4j.properties?


> 3) I have rebuild nutch followed by a cluster restart.
>

There is no need for a cluster restart. All you need to do is deploy the
new .job file and you should be good to go. What is always a good option,
it to make sure that stuff is working locally prior to deployment on a
cluster. You may be able to easily test and debug your code by using the
parsechecker tool.


>
> Still i am unable to see the output of this line below anywhere in console
> and logs!
> LOG.debug("Found keys");
>

You are not looking for this line of logging though right??? You are
looking for LOG.debug("Found keys : {} \t {}", lcMetatag, value);
Lewis