Java – how to record the execution of the nutch plug-in

I'm trying to build a custom nutch plug-in with special requirements

I'm in Hadoop Log, but it has no relevance

I added a log at different locations in my code Debug ("test") and log Info ("test2"), I'm at log4j Properties

# Logging for development
log4j.logger.org.apache.nutch.parse.html=DEBUG

My question is: where can I find these messages? I have checked Hadoop But I can't find anything?

How do I record / track my java code? (I'm not using eclipse.)

thank you

Solution

If your plug-in has class variable

public static final Log LOG = LogFactory.getLog(YourClass.class
        .getName());

Your methods of being called are:

LOG.info("Your Logmessage");

You have built your plug-in and configured nutch to use your plug-in when getting / crawling /... And then in Hadoop Log

When you build nutch, does it say it is building your plug-in?

If so, you can check your plug-in configuration, which is deployed to nutchhome / Runtime / local / conf / nutch site xml:

<property>
<name>plugin.includes</name>
<value>protocol-http|urlfilter-regex|parse-(html)|yourplugin</value>
<description>The plugins which are used in every crawl ordered by call-  order</description>
</property>

If your plug - in is configured in the runtime environment If not, change the configuration file and rebuild nutch If this does not help, you can provide more information

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>