For the newest version of Log4j2, this is what the docs recommend:
ConfigurationFactory.getInstance() .getConfiguration( null, null, URI.create("uri://to/my/log4j2.xml"));