o using slf4j 1.7.4 which adds the method to clear the logger cache

o update the code to use slf4j 1.7.4
o the logging failures in the embedded ITs are now fixed
This commit is contained in:
Jason van Zyl 2013-03-18 11:01:40 -07:00
parent 4849df9183
commit cc2da2fabe
3 changed files with 17 additions and 1 deletions

View File

@ -58,5 +58,20 @@ public void activate()
// property for root logger level or System.out redirection need to be taken into account
MavenSlf4jFriend.reset();
MavenSlf4jSimpleFriend.init();
try
{
org.slf4j.ILoggerFactory loggerFactory = org.slf4j.LoggerFactory.getILoggerFactory();
synchronized ( loggerFactory )
{
java.lang.reflect.Field loggerMap = loggerFactory.getClass().getDeclaredField( "loggerMap" );
loggerMap.setAccessible( true );
( (java.util.Map) loggerMap.get( loggerFactory ) ).clear();
}
}
catch ( Exception e )
{
// ignore for now...
}
}
}

View File

@ -28,5 +28,6 @@ public class MavenSlf4jSimpleFriend
public static void init()
{
SimpleLogger.init();
SimpleLoggerFactory.INSTANCE.reset();
}
}

View File

@ -59,7 +59,7 @@
<modelloVersion>1.7</modelloVersion>
<jxpathVersion>1.3</jxpathVersion>
<aetherVersion>1.13.1</aetherVersion>
<slf4jVersion>1.7.2</slf4jVersion>
<slf4jVersion>1.7.4</slf4jVersion>
<maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
<!-- Control the name of the distribution and information output by mvn -->
<distributionId>apache-maven</distributionId>