Search in sources :

Example 1 with DolphinLoggerBridgeFactory

use of com.canoo.platform.logging.spi.DolphinLoggerBridgeFactory in project dolphin-platform by canoo.

the class DolphinLoggerFactory method configure.

public synchronized void configure(final DolphinLoggerConfiguration configuration) {
    Assert.requireNonNull(configuration, "configuration");
    bridges.clear();
    final Iterator<DolphinLoggerBridgeFactory> iterator = ServiceLoader.load(DolphinLoggerBridgeFactory.class).iterator();
    while (iterator.hasNext()) {
        final DolphinLoggerBridge bridge = iterator.next().create(configuration);
        if (bridge != null) {
            bridges.add(bridge);
        }
    }
    markers.clear();
    for (final DolphinLogger logger : loggerMap.values()) {
        logger.updateBridges(Collections.unmodifiableList(bridges));
        final Level level = configuration.getLevelFor(logger.getName());
        logger.setLevel(level);
    }
    this.configuration = configuration;
    configured.set(true);
}
Also used : DolphinLoggerBridge(com.canoo.platform.logging.spi.DolphinLoggerBridge) Level(org.slf4j.event.Level) DolphinLoggerBridgeFactory(com.canoo.platform.logging.spi.DolphinLoggerBridgeFactory)

Aggregations

DolphinLoggerBridge (com.canoo.platform.logging.spi.DolphinLoggerBridge)1 DolphinLoggerBridgeFactory (com.canoo.platform.logging.spi.DolphinLoggerBridgeFactory)1 Level (org.slf4j.event.Level)1