[
https://issues.apache.org/jira/browse/PIG-1697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Laukik Chitnis updated PIG-1697:
--------------------------------
Attachment: PIG-1697.patch
I have tested this manually by passing the log4j properties file at command
line. I did not add a test case due to the effort required in putting a
framework in place to simulate files passed at command line (and hence the
overall -1)
I have verified that all unit tests pass.
{noformat}
[exec] -1 overall.
[exec]
[exec] +1 @author. The patch does not contain any @author tags.
[exec]
[exec] -1 tests included. The patch doesn't appear to include any new
or modified tests.
[exec] Please justify why no tests are needed for
this patch.
[exec]
[exec] +1 javadoc. The javadoc tool did not generate any warning
messages.
[exec]
[exec] +1 javac. The applied patch does not increase the total number
of javac compiler warnings.
[exec]
[exec] +1 findbugs. The patch does not introduce any new Findbugs
warnings.
[exec]
[exec] +1 release audit. The applied patch does not increase the
total number of release audit warnings.
[exec]
{noformat}
> NullPointerException if log4j.properties is Used
> ------------------------------------------------
>
> Key: PIG-1697
> URL: https://issues.apache.org/jira/browse/PIG-1697
> Project: Pig
> Issue Type: Bug
> Components: impl
> Affects Versions: 0.8.0
> Reporter: Ranjit Mathew
> Assignee: Laukik Chitnis
> Labels: logging
> Attachments: PIG-1697.patch, pig-issue-1697.tar.gz
>
>
> 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.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira