Handle null log4j logger param to constructor better than just causing NullPointerException.
Thanks to Lilianne E. Blaze for the patch; see jira LOGGING-111. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@476774 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -109,9 +109,14 @@ public class Log4JLogger implements Log, Serializable {
|
||||
this.logger = getLogger();
|
||||
}
|
||||
|
||||
/** For use with a log4j factory.
|
||||
/**
|
||||
* For use with a log4j factory.
|
||||
*/
|
||||
public Log4JLogger(Logger logger ) {
|
||||
if (logger == null) {
|
||||
throw new IllegalArgumentException(
|
||||
"Warning - null logger in constructor; possible log4j misconfiguration.");
|
||||
}
|
||||
this.name = logger.getName();
|
||||
this.logger=logger;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user