I want to load Log4j2 XML configuration file programmatically from my application.
Tried this:
ConfigurationSource source = new ConfigurationSource()
final URL log4j = Resources.getResource("log4j2-test.xml"); LoggerContext.getContext(false) .start(new XmlConfiguration(new ConfigurationSource( Resources.asByteSource(log4j).openStream(), log4j)));