Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

I have created simple Pig UDF in java on Hortonworks Sandbox and trying to log the message.It's not showing any log messages in stdout.

Highlighted

I have created simple Pig UDF in java on Hortonworks Sandbox and trying to log the message.It's not showing any log messages in stdout.

New Contributor

public class TestUdf extends EvalFunc<String>{

@Override public String exec(Tuple input) throws IOException

{

log.info("My message*********************");

String inputData = (String)input.get(0);

return inputData;

}

}

Please check my pig log Properties file in screenshot which is being used by my pig script as shown below.

REGISTER hdfs:///user/maria_dev/test.jar;
aa = LOAD 'mydoc' USING PigStorage('\t') as (email: chararray) ;
finaloutput =FOREACH aa GENERATE  test.TestUdf(email)  as email;
dump finaloutput;

log.png
2 REPLIES 2
Highlighted

Re: I have created simple Pig UDF in java on Hortonworks Sandbox and trying to log the message.It's not showing any log messages in stdout.

Contributor

Seems like you are adding these properties directly in the pig properties. Have you tried configuring the actual log4j.properties file that pig uses (I believe under /etc/pig/conf)?

Highlighted

Re: I have created simple Pig UDF in java on Hortonworks Sandbox and trying to log the message.It's not showing any log messages in stdout.

New Contributor

I am adding pig log4j.properties from ambari gui .Thanks

Don't have an account?
Coming from Hortonworks? Activate your account here