I can see both sides of the argument. Rather than changing the semantics of the existing method, what about adding a method `Configurator.initializeStrict(String, String)` which fails if the specified file doesn't exist? Not sure what the best way to fail is: return null or throw exception...
Sent from my iPhone > On Apr 12, 2017, at 9:13, Gary Gregory <garydgreg...@gmail.com> wrote: > > Hi All: > > Using 2.8.2, I call > org.apache.logging.log4j.core.config.Configurator.initialize(String, String) > with a non-exiting file location. > > The method does not return null because it found another log4j2.xml file on > my classpath. So I get a LoggerContext but not what I expect... > > That does not sound right to me, it should return null, and then I can look > in the status logger to see what went wrong (if I happen to have it set to > DEBUG in the log4j2.xml file it did find.) > > Thoughts? > > Gary > > -- > E-Mail: garydgreg...@gmail.com | ggreg...@apache.org > Java Persistence with Hibernate, Second Edition > JUnit in Action, Second Edition > Spring Batch in Action > Blog: http://garygregory.wordpress.com > Home: http://garygregory.com/ > Tweet! http://twitter.com/GaryGregory