Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Pig >> mail # user >> how to get the detailed  warn or error log message from pig udfs


Copy link to this message
-
how to get the detailed  warn or error log message from pig udfs

hey,guys,
   is there any way to log the detailed warn or error message from my udfs ?  Apache Pig version 0.8.1-cdh3u1  
   i wrote the udf warn like this:
  
IpRegion region = null;
try {
region = IPAnalyzeSingleton.getInstance().citySeek(ip);
} catch (Exception e) {
warn("invalid ip[" + ip + "],will return -1 .", PigWarning.UDF_WARNING_1);
return -1;
}
  
   after run the script with this command:  pig -4 /tmp/log4j.properties test.pig

   only got the count numbers of the warns,but i meaned to get the detailed warn info.
   WARN main org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher - Encountered Warning UDF_WARNING_1 9261846 time(s).

   the log4j configure as follows:
  
log4j.rootLogger=WARN, B

log4j.appender.B = org.apache.log4j.DailyRollingFileAppender
log4j.appender.B.File = /tmp/pig/logs/log.log
log4j.appender.B.DatePattern='.'yyyy-MM-dd
log4j.appender.B.Append = true
log4j.appender.B.Threshold = WARN
log4j.appender.B.layout = org.apache.log4j.PatternLayout
log4j.appender.B.layout.ConversionPattern = %p %t %c - %m%n
lucas
+
Ruslan Al-Fakikh 2013-04-17, 16:05
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB