Java源码示例:org.ops4j.pax.logging.spi.PaxAppender

示例1
@Activate
protected void activate(ComponentContext componentContext) {

    LoggingAppender loggingAppender = new LoggingAppender(DataHolder.getInstance().getLogBuffer());
    Hashtable<String, Object> props = new Hashtable();
    props.put("org.ops4j.pax.logging.appender.name", "InMemoryLogAppender");
    componentContext.getBundleContext().registerService(PaxAppender.class, loggingAppender, props);
}
 
示例2
public LogCollector(BundleContext context) {
    Dictionary<String, String> props = new Hashtable<>();
    props.put("org.ops4j.pax.logging.appender.name", "ITestLogAppender");
    reg = context.registerService(PaxAppender.class, this, props);
}