Project: mule
Issue MULE-8383: log4j2.xml not being loaded during functional test case
When doing a functional test case logs are not active by default. The idea should be that if I place a log4j2.xml in some place in the classpath then I should be able to enable logs. What happens is that this file is not getting picked up. Doesn't really matter in which part of the application folder structure is placed it doesn't get loaded. If you run a test the only thing you see is: WARN 2015-03-13 10:11:07,233 [main] org.mule.tck.junit4.AbstractMuleTestCase: -------------------------------------------------------------------------------- Hung threads count: 2. Test case: org.mule.munit.TheTest. Thread names: -> AsyncLoggerConfig-1 - 10 -> ReaderThread - 8 -------------------------------------------------------------------------------- Now you try to configure Log4j2 on your own the logs start working just fine but in order to do that you need to add this code to your test: try {	URI configuration;	configuration = Thread.currentThread().getContextClassLoader().getResource("log4j2.xml").toURI();	Configurator.initialize("config", null, configuration);	} catch (URISyntaxException e) {	e.printStackTrace();	} Please check the attached project for more data. Please notice that the application has just a logger MP with level Debug which by default shouldn't be printed unless you change the logs (which works just fine when running mule normally)
Story points: 5