org.zodiac.sdk.log.factory.LogbackLoggerSpaceFactory Maven / Gradle / Ivy
The newest version!
package org.zodiac.sdk.log.factory;
import ch.qos.logback.classic.encoder.PatternLayoutEncoder;
import ch.qos.logback.classic.filter.ThresholdFilter;
import org.zodiac.sdk.log.CommonLoggingConfigurations;
import org.zodiac.sdk.log.adapter.level.AdapterLevel;
import org.zodiac.sdk.log.constants.LogConstants;
import org.zodiac.sdk.toolkit.space.SpaceId;
import org.zodiac.sdk.toolkit.util.lang.StrUtil;
import java.net.URL;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
public class LogbackLoggerSpaceFactory extends AbstractLoggerSpaceFactory {
private SpaceId spaceId;
private ch.qos.logback.classic.LoggerContext loggerContext;
private Properties properties;
/**
* key: spanId, value: consoleAppender each logger have their own consoleAppender if had configured.
**/
private ConcurrentMap> consoleAppenders = new ConcurrentHashMap<>();
public LogbackLoggerSpaceFactory(SpaceId spaceId, ch.qos.logback.classic.LoggerContext loggerContext, Properties properties, URL confFile,
String source) {
super(source);
this.spaceId = spaceId;
this.loggerContext = loggerContext;
this.properties = properties;
for (Map.Entry