Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Kapukaranov2012-06-25 08:21:06 +0000
committerBorislav Kapukaranov2012-06-25 08:21:06 +0000
commit64b41c41a823c52547ef3511753f80d2922c8184 (patch)
treec74b0c2a6c02bf435abd14893827116479bd8891
parente4894e35012bf9444a0e2a7d5fc75ae02010729f (diff)
downloadorg.eclipse.virgo.medic-64b41c41a823c52547ef3511753f80d2922c8184.tar.gz
org.eclipse.virgo.medic-64b41c41a823c52547ef3511753f80d2922c8184.tar.xz
org.eclipse.virgo.medic-64b41c41a823c52547ef3511753f80d2922c8184.zip
Upgrades to Juno Equinox versions
-rw-r--r--build.versions14
-rw-r--r--org.eclipse.virgo.medic.core/.classpath14
-rw-r--r--org.eclipse.virgo.medic.core/ivy.xml18
-rwxr-xr-xorg.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/LogController.java156
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/config/ConfigurationAdminConfigurationProvider.java42
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/config/ConfigurationProvider.java24
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/management/FileSystemDumpInspector.java16
-rw-r--r--org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/dump/impl/StandardDumpGeneratorTests.java66
-rw-r--r--org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/eventlog/impl/logback/LogBackEventLoggerTests.java56
-rwxr-xr-xorg.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/impl/LogControllerTests.java120
-rw-r--r--org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/impl/config/ConfigurationAdminConfigurationProviderTests.java106
-rw-r--r--org.eclipse.virgo.medic.core/src/test/java/org/eclipse/virgo/medic/management/FileSystemDumpInspectorTests.java12
-rw-r--r--org.eclipse.virgo.medic.core/template.mf7
-rw-r--r--org.eclipse.virgo.medic.integrationtest/ivy.xml18
-rw-r--r--org.eclipse.virgo.medic.integrationtest/src/test/resources/META-INF/test.config.properties25
-rw-r--r--org.eclipse.virgo.medic.integrationtest/src/test/resources/appender-fragment/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.virgo.medic.logbackclassicfragment/template.mf2
-rw-r--r--org.eclipse.virgo.medic.logbackcorefragment/template.mf2
-rw-r--r--org.eclipse.virgo.medic.testfragment/ivy.xml4
-rw-r--r--org.eclipse.virgo.medic.testfragment/template.mf2
-rw-r--r--org.eclipse.virgo.medic/ivy.xml4
-rw-r--r--org.eclipse.virgo.medic/template.mf2
22 files changed, 362 insertions, 350 deletions
diff --git a/build.versions b/build.versions
index 4210772..8a64207 100644
--- a/build.versions
+++ b/build.versions
@@ -1,10 +1,14 @@
# Compile
-ch.qos.logback=0.9.28
+ch.qos.logback.classic=1.0.0.v20111214-2030
+ch.qos.logback.core=1.0.0.v20111214-2030
+ch.qos.logback.slf4j=1.0.0.v20120123-1500
+org.slf4j.api=1.6.1.v20100831-0715
+org.slf4j.jul=1.6.1.v20100831-0715
org.slf4j=1.6.1
-org.eclipse.osgi=3.7.1.R37x_v20110808-1106
-org.eclipse.osgi.services=3.3.0.v20110513
-org.eclipse.equinox.log=1.0.0
-org.eclipse.equinox.cm=1.0.300.v20101204
+org.eclipse.osgi=3.8.0.v20120508-2119
+org.eclipse.osgi.services=3.3.0.v20120307-2102
+org.eclipse.equinox.log=1.2.200.v20111010-1614
+org.eclipse.equinox.cm=1.0.400.v20120319-2029
org.aspectj=1.6.12.RELEASE
# Test
diff --git a/org.eclipse.virgo.medic.core/.classpath b/org.eclipse.virgo.medic.core/.classpath
index c2b1869..d78b2c4 100644
--- a/org.eclipse.virgo.medic.core/.classpath
+++ b/org.eclipse.virgo.medic.core/.classpath
@@ -25,20 +25,20 @@
</attributes>
</classpathentry>
<classpathentry kind="var" path="MEDIC_IVY_CACHE/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-4.7.0.jar" sourcepath="/MEDIC_IVY_CACHE/org.junit/com.springsource.org.junit/4.7.0/com.springsource.org.junit-sources-4.7.0.jar"/>
- <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.7.1.R37x_v20110808-1106/org.eclipse.osgi-3.7.1.R37x_v20110808-1106.jar" sourcepath="/MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.7.1.R37x_v20110808-1106/org.eclipse.osgi-sources-3.7.1.R37x_v20110808-1106.jar"/>
<classpathentry kind="var" path="MEDIC_IVY_CACHE/org.easymock/com.springsource.org.easymock/2.3.0/com.springsource.org.easymock-2.3.0.jar" sourcepath="/MEDIC_IVY_CACHE/org.easymock/com.springsource.org.easymock/2.3.0/com.springsource.org.easymock-sources-2.3.0.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.virgo.medic"/>
<classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.virgo.teststubs/org.eclipse.virgo.teststubs.osgi/3.5.0.D-20120615065132/org.eclipse.virgo.teststubs.osgi-3.5.0.D-20120615065132.jar" sourcepath="/MEDIC_IVY_CACHE/org.eclipse.virgo.teststubs/org.eclipse.virgo.teststubs.osgi/3.5.0.D-20120615065132/org.eclipse.virgo.teststubs.osgi-sources-3.5.0.D-20120615065132.jar"/>
<classpathentry kind="var" path="MEDIC_IVY_CACHE/org.aspectj/com.springsource.org.aspectj.runtime/1.6.12.RELEASE/com.springsource.org.aspectj.runtime-1.6.12.RELEASE.jar" sourcepath="/MEDIC_IVY_CACHE/org.aspectj/com.springsource.org.aspectj.runtime/1.6.12.RELEASE/com.springsource.org.aspectj.runtime-sources-1.6.12.RELEASE.jar"/>
- <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.slf4j/com.springsource.slf4j.api/1.6.1/com.springsource.slf4j.api-1.6.1.jar" sourcepath="/MEDIC_IVY_CACHE/org.slf4j/com.springsource.slf4j.api/1.6.1/com.springsource.slf4j.api-sources-1.6.1.jar"/>
- <classpathentry kind="var" path="MEDIC_IVY_CACHE/ch.qos.logback/com.springsource.ch.qos.logback.classic/0.9.28/com.springsource.ch.qos.logback.classic-0.9.28.jar" sourcepath="/MEDIC_IVY_CACHE/ch.qos.logback/com.springsource.ch.qos.logback.classic/0.9.24/com.springsource.ch.qos.logback.classic-sources-0.9.24.jar"/>
- <classpathentry kind="var" path="MEDIC_IVY_CACHE/ch.qos.logback/com.springsource.ch.qos.logback.core/0.9.28/com.springsource.ch.qos.logback.core-0.9.28.jar" sourcepath="/MEDIC_IVY_CACHE/ch.qos.logback/com.springsource.ch.qos.logback.core/0.9.24/com.springsource.ch.qos.logback.core-sources-0.9.24.jar"/>
<classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.osgi/3.5.0.D-20120615065828/org.eclipse.virgo.util.osgi-3.5.0.D-20120615065828.jar" sourcepath="/MEDIC_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.osgi/3.5.0.D-20120615065828/org.eclipse.virgo.util.osgi-sources-3.5.0.D-20120615065828.jar"/>
<classpathentry kind="con" path="org.eclipse.ajdt.core.ASPECTJRT_CONTAINER"/>
- <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.equinox.cm/1.0.300.v20101204/org.eclipse.equinox.cm-1.0.300.v20101204.jar" sourcepath="/MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.equinox.cm/1.0.300.v20101204/org.eclipse.equinox.cm-sources-1.0.300.v20101204.jar"/>
- <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi.services/3.3.0.v20110513/org.eclipse.osgi.services-3.3.0.v20110513.jar" sourcepath="/MEDIC_IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi.services/3.3.0.v20110513/org.eclipse.osgi.services-sources-3.3.0.v20110513.jar"/>
<classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.io/3.5.0.D-20120615065828/org.eclipse.virgo.util.io-3.5.0.D-20120615065828.jar" sourcepath="/MEDIC_IVY_CACHE/org.eclipse.virgo.util/org.eclipse.virgo.util.io/3.5.0.D-20120615065828/org.eclipse.virgo.util.io-sources-3.5.0.D-20120615065828.jar"/>
- <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.slf4j/com.springsource.slf4j.bridge/1.6.1/com.springsource.slf4j.bridge-1.6.1.jar"/>
+ <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.virgo.mirrored/ch.qos.logback.classic/1.0.0.v20111214-2030/ch.qos.logback.classic-1.0.0.v20111214-2030.jar"/>
+ <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.virgo.mirrored/ch.qos.logback.core/1.0.0.v20111214-2030/ch.qos.logback.core-1.0.0.v20111214-2030.jar"/>
+ <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.virgo.mirrored/org.eclipse.equinox.cm/1.0.400.v20120319-2029/org.eclipse.equinox.cm-1.0.400.v20120319-2029.jar"/>
+ <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.virgo.mirrored/org.eclipse.osgi.services/3.3.0.v20120307-2102/org.eclipse.osgi.services-3.3.0.v20120307-2102.jar"/>
+ <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.virgo.mirrored/org.eclipse.osgi/3.8.0.v20120508-2119/org.eclipse.osgi-3.8.0.v20120508-2119.jar"/>
+ <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.virgo.mirrored/org.slf4j.api/1.6.1.v20100831-0715/org.slf4j.api-1.6.1.v20100831-0715.jar"/>
+ <classpathentry kind="var" path="MEDIC_IVY_CACHE/org.eclipse.virgo.mirrored/org.slf4j.jul/1.6.1.v20100831-0715/org.slf4j.jul-1.6.1.v20100831-0715.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
diff --git a/org.eclipse.virgo.medic.core/ivy.xml b/org.eclipse.virgo.medic.core/ivy.xml
index d09c56e..6100033 100644
--- a/org.eclipse.virgo.medic.core/ivy.xml
+++ b/org.eclipse.virgo.medic.core/ivy.xml
@@ -19,23 +19,25 @@
<dependencies>
<dependency org="org.eclipse.virgo.medic" name="org.eclipse.virgo.medic" rev="latest.integration" conf="compile->compile"/>
- <dependency org="org.slf4j" name="com.springsource.slf4j.api" rev="${org.slf4j}" conf="compile->runtime"/>
- <dependency org="org.slf4j" name="com.springsource.slf4j.bridge" rev="${org.slf4j}" conf="compile->runtime"/>
+ <dependency org="org.eclipse.virgo.mirrored" name="org.eclipse.equinox.log" rev="${org.eclipse.equinox.log}" conf="compile->runtime"/>
+ <dependency org="org.eclipse.virgo.mirrored" name="org.slf4j.api" rev="${org.slf4j.api}" conf="compile->runtime"/>
+ <dependency org="org.eclipse.virgo.mirrored" name="org.slf4j.jul" rev="${org.slf4j.jul}" conf="compile->runtime"/>
<dependency org="org.eclipse.virgo.util" name="org.eclipse.virgo.util.osgi" rev="${org.eclipse.virgo.util}" conf="compile->runtime"/>
<dependency org="org.eclipse.virgo.util" name="org.eclipse.virgo.util.io" rev="${org.eclipse.virgo.util}" conf="compile->runtime"/>
- <dependency org="ch.qos.logback" name="com.springsource.ch.qos.logback.classic" rev="${ch.qos.logback}" conf="compile->runtime"/>
- <dependency org="ch.qos.logback" name="com.springsource.ch.qos.logback.core" rev="${ch.qos.logback}" conf="compile->runtime"/>
- <dependency org="org.eclipse.osgi" name="org.eclipse.osgi" rev="${org.eclipse.osgi}" conf="provided->runtime"/>
+ <dependency org="org.eclipse.virgo.mirrored" name="ch.qos.logback.classic" rev="${ch.qos.logback.classic}" conf="compile->runtime"/>
+ <dependency org="org.eclipse.virgo.mirrored" name="ch.qos.logback.core" rev="${ch.qos.logback.core}" conf="compile->runtime"/>
+ <dependency org="org.eclipse.virgo.mirrored" name="ch.qos.logback.slf4j" rev="${ch.qos.logback.slf4j}" conf="compile->runtime"/>
+ <dependency org="org.eclipse.virgo.mirrored" name="org.eclipse.osgi" rev="${org.eclipse.osgi}" conf="provided->runtime"/>
- <dependency org="org.eclipse.osgi" name="org.eclipse.osgi.services" rev="${org.eclipse.osgi.services}" conf="optional->runtime"/>
- <dependency org="org.eclipse.osgi" name="org.eclipse.equinox.cm" rev="${org.eclipse.equinox.cm}" conf="optional->runtime"/>
+ <dependency org="org.eclipse.virgo.mirrored" name="org.eclipse.osgi.services" rev="${org.eclipse.osgi.services}" conf="optional->runtime"/>
+ <dependency org="org.eclipse.virgo.mirrored" name="org.eclipse.equinox.cm" rev="${org.eclipse.equinox.cm}" conf="optional->runtime"/>
<dependency org="org.junit" name="com.springsource.org.junit" rev="${org.junit}" conf="test->runtime"/>
<dependency org="org.easymock" name="com.springsource.org.easymock" rev="${org.easymock}" conf="test->runtime"/>
<dependency org="org.eclipse.virgo.teststubs" name="org.eclipse.virgo.teststubs.osgi" rev="${org.eclipse.virgo.teststubs}" conf="test->runtime"/>
<!-- Allow Equinox to be upgraded point-wise before rippling -->
- <override org="org.eclipse.osgi" module="org.eclipse.osgi" rev="${org.eclipse.osgi}"/>
+ <exclude org="org.eclipse.osgi"/>
</dependencies>
</ivy-module>
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/LogController.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/LogController.java
index 2da167d..da2343d 100755
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/LogController.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/LogController.java
@@ -49,132 +49,132 @@ import java.util.logging.Handler;
import java.util.logging.Logger;
public class LogController implements ConfigurationChangeListener {
-
+
private static final String LOGGER_NAME_SYSERR = "System.err";
-
+
private static final String LOGGER_NAME_SYSOUT = "System.out";
-
+
private static final String LOGGER_NAME_SYSERR_DELEGATE = "delegating.System.err";
-
+
private static final String LOGGER_NAME_SYSOUT_DELEGATE = "delegating.System.out";
-
+
private static final String PROPERTY_MEDIC_CONFIG_PATH = "org.eclipse.virgo.medic.log.config.path";
-
+
private static final String DEFAULT_CONTEXT_SELECTOR = "ch.qos.logback.classic.selector.DefaultContextSelector";
-
+
private static final String PROPERTY_LOGBACK_CONTEXT_SELECTOR = "logback.ContextSelector";
-
+
private volatile StandardDumpGenerator dumpGenerator;
-
+
private volatile LogBackEventLoggerFactory eventLoggerFactory;
-
+
private volatile DumpContributorPublisher dumpContributorPublisher;
-
+
private volatile PrintStream sysOut = System.out;
-
+
private volatile PrintStream sysErr = System.err;
-
+
private volatile ExecutionStackAccessor stackAccessor;
-
+
private volatile ConsoleHandler javaConsoleHandler;
private DelegatingPrintStream delegatingSysOut = new StandardDelegatingPrintStream(System.out);
-
+
private DelegatingPrintStream delegatingSysErr = new StandardDelegatingPrintStream(System.err);
-
+
private ServiceRegistration<DelegatingPrintStream> delegatingSysOutRegistration;
private ServiceRegistration<DelegatingPrintStream> delegatingSysErrRegistration;
-
+
private ServiceRegistration<PrintStream> sysOutRegistration;
private ServiceRegistration<PrintStream> sysErrRegistration;
-
+
private static final List<String> DEFAULT_LOGGING_PACKAGES = Arrays.asList(//
- "org.apache.commons.logging",//
- "org.apache.log4j",//
- "org.slf4j",//
- "org.slf4j.impl",//
- "org.eclipse.virgo.medic.log",//
- "org.eclipse.virgo.medic.log.logback",//
- "org.eclipse.virgo.medic.log.impl",//
- "org.eclipse.virgo.medic.log.impl.logback");
-
+ "org.apache.commons.logging",//
+ "org.apache.log4j",//
+ "org.slf4j",//
+ "org.slf4j.impl",//
+ "org.eclipse.virgo.medic.log",//
+ "org.eclipse.virgo.medic.log.logback",//
+ "org.eclipse.virgo.medic.log.impl",//
+ "org.eclipse.virgo.medic.log.impl.logback");
+
private BundleContext bundleContext;
private ConfigurationProvider configurationProvider;
private ServiceRegistrationTracker registrationTracker;
-
+
public LogController(BundleContext ctx, ConfigurationProvider cfgProvider, ServiceRegistrationTracker regTracker) throws ConfigurationPublicationFailedException {
this.bundleContext = ctx;
this.configurationProvider = cfgProvider;
this.registrationTracker = regTracker;
-
+
StandardContextSelectorDelegate delegate = createContextSelectorDelegate(bundleContext);
registrationTracker.track(bundleContext.registerService(BundleListener.class.getName(), delegate, null));
DelegatingContextSelector.setDelegate(delegate);
-
+
StandardLoggingConfigurationPublisher loggingConfigurationPublisher = new StandardLoggingConfigurationPublisher(bundleContext);
registrationTracker.track(bundleContext.registerService(LoggingConfigurationPublisher.class, loggingConfigurationPublisher, null));
-
+
publishDefaultConfigurationIfAvailable(bundleContext, loggingConfigurationPublisher);
-
+
System.setProperty(PROPERTY_LOGBACK_CONTEXT_SELECTOR, DelegatingContextSelector.class.getName());
-
+
this.stackAccessor = new SecurityManagerExecutionStackAccessor();
-
+
this.sysOut = System.out;
this.sysErr = System.err;
}
-
+
public DumpGenerator dumpStart() {
this.dumpGenerator = new StandardDumpGenerator(new StandardDumpContributorResolver(bundleContext), configurationProvider, this.eventLoggerFactory.createEventLogger(bundleContext.getBundle()));
registrationTracker.track(bundleContext.registerService(DumpGenerator.class, this.dumpGenerator, null));
-
+
this.dumpContributorPublisher = new DumpContributorPublisher(bundleContext);
this.dumpContributorPublisher.publishDumpContributors();
return this.dumpGenerator;
}
-
+
public void dumpStop() {
if (this.dumpGenerator != null) {
this.dumpGenerator.close();
}
-
+
if (this.dumpContributorPublisher != null) {
this.dumpContributorPublisher.retractDumpContributors();
}
}
-
+
public void logStart() throws ConfigurationPublicationFailedException {
- Dictionary<String, String> configuration = configurationProvider.getConfiguration();
-
+ Dictionary<String, Object> configuration = configurationProvider.getConfiguration();
+
SLF4JBridgeHandler.install();
-
+
updateLogConfiguration(configuration);
}
-
+
public void logStop() {
System.setProperty(PROPERTY_LOGBACK_CONTEXT_SELECTOR, DEFAULT_CONTEXT_SELECTOR);
-
+
DelegatingContextSelector.setDelegate(null);
-
+
if (this.sysOut != null) {
System.setOut(this.sysOut);
}
-
+
if (this.sysErr != null) {
System.setErr(this.sysErr);
}
-
+
SLF4JBridgeHandler.uninstall();
enableJulConsoleLogger();
}
-
+
private void enableJulConsoleLogger() {
if (this.javaConsoleHandler != null) {
getJavaRootLogger().addHandler(this.javaConsoleHandler);
}
}
-
+
private void disableJulConsoleHandler() {
// remove console handler from root logger
Logger rootLogger = getJavaRootLogger();
@@ -186,39 +186,39 @@ public class LogController implements ConfigurationChangeListener {
}
}
}
-
+
public void eventLogStart() {
this.eventLoggerFactory = createFactory(bundleContext);
ServiceFactory<EventLogger> serviceFactory = new EventLoggerServiceFactory(this.eventLoggerFactory);
registrationTracker.track(bundleContext.registerService(EventLoggerFactory.class, this.eventLoggerFactory, null));
registrationTracker.track(bundleContext.registerService(EventLogger.class.getName(), serviceFactory, null));
}
-
+
private PrintStream wrapPrintStream(PrintStream printStream, String loggerName, LoggingLevel loggingLevel, ExecutionStackAccessor stackAccessor, ConfigurationProvider configurationProvider, String configurationProperty) {
LoggingPrintStreamWrapper wrapper = new LoggingPrintStreamWrapper(printStream, loggerName, loggingLevel, stackAccessor, configurationProvider, configurationProperty);
return wrapper;
}
-
+
private ServiceRegistration<PrintStream> publishPrintStream(PrintStream printStream, String name) {
Dictionary<String, String> properties = new Hashtable<String, String>();
properties.put("org.eclipse.virgo.medic.log.printStream", name);
-
+
ServiceRegistration<PrintStream> registration = bundleContext.registerService(PrintStream.class, printStream, properties);
registrationTracker.track(registration);
-
+
return registration;
}
-
+
private ServiceRegistration<DelegatingPrintStream> publishDelegatingPrintStream(DelegatingPrintStream printStream, String name) {
Dictionary<String, String> properties = new Hashtable<String, String>();
properties.put("org.eclipse.virgo.medic.log.printStream", name);
-
+
ServiceRegistration<DelegatingPrintStream> delegatingPrintStreamRegistration = bundleContext.registerService(DelegatingPrintStream.class, printStream, properties);
registrationTracker.track(delegatingPrintStreamRegistration);
-
+
return delegatingPrintStreamRegistration;
}
-
+
private void publishDefaultConfigurationIfAvailable(BundleContext context, StandardLoggingConfigurationPublisher publisher) throws ConfigurationPublicationFailedException {
String logConfigPath = context.getProperty(PROPERTY_MEDIC_CONFIG_PATH);
if (logConfigPath != null) {
@@ -228,14 +228,14 @@ public class LogController implements ConfigurationChangeListener {
}
}
}
-
+
private static StandardContextSelectorDelegate createContextSelectorDelegate(BundleContext bundleContext) {
ConfigurationLocator configurationLocator = createConfigurationLocator(bundleContext);
CallingBundleResolver loggingCallerLocator = createLoggingCallerLocator();
LoggerContextConfigurer loggerContextConfigurer = new JoranLoggerContextConfigurer();
return new StandardContextSelectorDelegate(loggingCallerLocator, configurationLocator, bundleContext.getBundle(), loggerContextConfigurer);
}
-
+
/**
* Logging configuration is located by searching up to two sources, depending on the bundle doing the logging.
* <p/>
@@ -246,42 +246,42 @@ public class LogController implements ConfigurationChangeListener {
private static ConfigurationLocator createConfigurationLocator(BundleContext bundleContext) {
return new CompositeConfigurationLocator(new ServiceRegistryConfigurationLocator(bundleContext), new BundleResourceConfigurationLocator());
}
-
+
private static CallingBundleResolver createLoggingCallerLocator() {
ClassSelector classSelector = createClassSelector();
ExecutionStackAccessor executionStackAccessor = createExecutionStackAccessor();
-
+
return new StandardCallingBundleResolver(executionStackAccessor, classSelector);
}
-
+
private static ClassSelector createClassSelector() {
return new PackageNameFilteringClassSelector(DEFAULT_LOGGING_PACKAGES);
}
-
+
private static ExecutionStackAccessor createExecutionStackAccessor() {
return new SecurityManagerExecutionStackAccessor();
}
-
+
private LogBackEventLoggerFactory createFactory(BundleContext context) {
BundleSearchingPropertyResourceBundleResolver resourceBundleResolver = new BundleSearchingPropertyResourceBundleResolver();
return new LogBackEventLoggerFactory(resourceBundleResolver, new StandardLocaleResolver(), context.getBundle());
}
-
+
private Logger getJavaRootLogger() {
return Logger.getLogger("");
}
-
+
@Override
public void configurationChanged(ConfigurationProvider provider) {
- Dictionary<String, String> configuration = configurationProvider.getConfiguration();
+ Dictionary<String, Object> configuration = configurationProvider.getConfiguration();
updateLogConfiguration(configuration);
}
-
- private synchronized void updateLogConfiguration(Dictionary<String, String> configuration) {
- if (Boolean.valueOf(configuration.get(ConfigurationProvider.KEY_LOG_WRAP_SYSOUT))) {
+
+ private synchronized void updateLogConfiguration(Dictionary<String, Object> configuration) {
+ if (Boolean.valueOf((String)configuration.get(ConfigurationProvider.KEY_LOG_WRAP_SYSOUT))) {
delegatingSysOutRegistration = publishDelegatingPrintStream(delegatingSysOut, LOGGER_NAME_SYSOUT_DELEGATE);
sysOutRegistration = publishPrintStream(this.sysOut, LOGGER_NAME_SYSOUT);
-
+
System.setOut(wrapPrintStream(System.out, LOGGER_NAME_SYSOUT, LoggingLevel.INFO, stackAccessor, configurationProvider, ConfigurationProvider.KEY_LOG_WRAP_SYSOUT));
} else {
if (delegatingSysOutRegistration != null) {
@@ -294,11 +294,11 @@ public class LogController implements ConfigurationChangeListener {
}
System.setOut((PrintStream)delegatingSysOut);