System out/err to SLF4j
This commit is contained in:
@@ -10,6 +10,7 @@ import org.apache.felix.framework.util.ImmutableMap;
|
||||
import org.osgi.framework.BundleActivator;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import uk.org.lidalia.sysoutslf4j.context.SysOutOverSLF4J;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.PreDestroy;
|
||||
@@ -39,6 +40,7 @@ public class Core {
|
||||
|
||||
private void startFelix() {
|
||||
logger.trace("starting Apache Felix (OSGi)");
|
||||
SysOutOverSLF4J.sendSystemOutAndErrToSLF4J();
|
||||
|
||||
try {
|
||||
felix = new Felix(createFelixConfig());
|
||||
@@ -73,7 +75,7 @@ public class Core {
|
||||
|
||||
@PreDestroy
|
||||
public void stop() {
|
||||
startFelix();
|
||||
stopFelix();
|
||||
}
|
||||
|
||||
private void stopFelix() {
|
||||
@@ -85,5 +87,7 @@ public class Core {
|
||||
} catch (Exception e) {
|
||||
logger.error("Error shutdown Felix", e);
|
||||
}
|
||||
|
||||
SysOutOverSLF4J.restoreOriginalSystemOutputs();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user