Log4j default initialization goes through a procedure to find and use a URL to configure with. Afterward, how can you find out what URL was ultimately used, without having
If you can setup your own Configurator you can do something like that:
Setup the JAVA system property : -Dlog4j.configuratorClass=MyConfigurator And then have your configurator instance intercepts the doConfigure call.
public class MyConfigurator implements Configurator
{
public static URL url;
@Override
public void doConfigure(URL url, LoggerRepository repository)
{
this.url = url;
new PropertyConfigurator().doConfigure(url, repository);
}
}