title: How to use multiple configuration files for log4j2
body: <p>I am writing Java code that tests a Java library. The library includes its own log4j2 configuration as part of the distribution.</p>
  
  <p>I would like to use log4j2 in my test code without modifying the library's configuration.</p>
  
  <p>Is there a way to have a separate log4j2 configuration for my test code?</p>
  
  <p>This is all running as command-line Java, no servers or web involvement at all.</p>
  
  <p>EDIT to try to be more clear:
  What I want is to be able to configure loggers, appenders, etc for the test code to use , and <em>at the same time</em> have the library code use <em>its own separate configuration file</em> for its logging. The idea is to use log4j2 in my test code, but without having to change the library's configuration file. Since the library configuration file is part of the library's distribution, I don't want to change it for testing.</p>