NullPointerException if log4j.properties is Used ------------------------------------------------
Key: PIG-1697 URL: https://issues.apache.org/jira/browse/PIG-1697 Project: Pig Issue Type: Bug Affects Versions: 0.8.0 Reporter: Ranjit Mathew If I use a {{log4j.properties}} _without_ the magical line: bq. log4j.logger.org.apache.pig=WARN, MyAppender Pig 0.8.0 crashes on me and I get: bq. Details at logfile: /home/ranjit/src/Pig/stage/pig-0.8.0-SNAPSHOT/pig_1288005234464.log This file contains: {quote} Error before Pig is launched ---------------------------- ERROR 2999: Unexpected internal error. null java.lang.NullPointerException at org.apache.pig.Main.configureLog4J(Main.java:605) at org.apache.pig.Main.run(Main.java:337) at org.apache.pig.Main.main(Main.java:107) ================================================================================ {quote} Line #605 in {{Main.java}} is: bq. backendProps.setProperty("log4j.logger.org.apache.pig.level", logLevel.toString()); and it turns out that {{logLevel}} is NULL in this case. That in turn is because line #603 contains: bq. logLevel = Logger.getLogger("org.apache.pig").getLevel(); I believe we should use {{Logger.getEffectiveLevel()}} instead. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.