org.apache.logging.log4j.core.Logger.getName()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(199)

本文整理了Java中org.apache.logging.log4j.core.Logger.getName()方法的一些代码示例,展示了Logger.getName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.getName()方法的具体详情如下:
包路径:org.apache.logging.log4j.core.Logger
类名称:Logger
方法名:getName

Logger.getName介绍

暂无

代码示例

代码示例来源:origin: apache/geode

public LoggerConfig getLoggerConfig() {
 final Logger logger = getLogger();
 final LoggerContext context = logger.getContext();
 return context.getConfiguration().getLoggerConfig(logger.getName());
}

代码示例来源:origin: alibaba/nacos

@Override
public void setLevel(Level level) {
  this.level = level;
  org.apache.logging.log4j.Level l = org.apache.logging.log4j.Level.toLevel(level.getName(),
    org.apache.logging.log4j.Level.ERROR);
  logger.setLevel(l);
  logger.getContext().getConfiguration().getLoggerConfig(this.logger.getName()).setLevel(l);
}

代码示例来源:origin: alibaba/nacos

@Override
public void activateAsync(List<Object[]> args) {
  Map<String, Appender> appenders = logger.getAppenders();
  if (appenders == null) {
    throw new IllegalStateException("Activate async appender failed, no appender exist.");
  }
  AppenderRef[] refs = new AppenderRef[appenders.size()];
  int i = 0;
  for (Appender appender : appenders.values()) {
    configuration.addAppender(appender);
    refs[i++] = AppenderRef.createAppenderRef(appender.getName(), null, null);
  }
  AsyncAppender.Builder builder = AsyncAppender.newBuilder()
    .setName(productName + "." + logger.getName() + ".AsyncAppender")
    .setConfiguration(configuration)
    .setAppenderRefs(refs)
    .setBlockingQueueFactory(ArrayBlockingQueueFactory.<LogEvent>createFactory());
  invokeMethod(builder, args);
  AsyncAppender asyncAppender = builder.build();
  asyncAppender.start();
  removeAllAppenders(logger);
  logger.addAppender(asyncAppender);
  setProductName(productName);
}

代码示例来源:origin: mulesoft/mule

DispatchingLogger(Logger originalLogger, int ownerClassLoaderHash, LoggerContext loggerContext, ContextSelector contextSelector,
         MessageFactory messageFactory) {
 super(loggerContext, originalLogger.getName(), messageFactory);
 this.originalLogger = originalLogger;
 this.contextSelector = contextSelector;
 this.ownerClassLoaderHash = ownerClassLoaderHash;
}

代码示例来源:origin: org.mule.runtime/mule-module-launcher

DispatchingLogger(Logger originalLogger, int ownerClassLoaderHash, LoggerContext loggerContext, ContextSelector contextSelector,
         MessageFactory messageFactory) {
 super(loggerContext, originalLogger.getName(), messageFactory);
 this.originalLogger = originalLogger;
 this.contextSelector = contextSelector;
 this.ownerClassLoaderHash = ownerClassLoaderHash;
}

代码示例来源:origin: org.mule.modules/mule-module-launcher

DispatchingLogger(Logger originalLogger, int ownerClassLoaderHash, LoggerContext loggerContext, ContextSelector contextSelector, MessageFactory messageFactory)
{
  super(loggerContext, originalLogger.getName(), messageFactory);
  this.originalLogger = originalLogger;
  this.contextSelector = contextSelector;
  this.ownerClassLoaderHash = ownerClassLoaderHash;
}

代码示例来源:origin: ops4j/org.ops4j.pax.logging

@Override
  public int hashCode() {
    return getName().hashCode();
  }
}

代码示例来源:origin: ops4j/org.ops4j.pax.logging

@Override
public boolean equals(final Object o) {
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  final Logger that = (Logger) o;
  return getName().equals(that.getName());
}

代码示例来源:origin: ChestShop-authors/ChestShop-3

@Override
public Result filter(org.apache.logging.log4j.core.Logger logger, Level level, Marker marker, String msg, Object... params) {
  return filter(logger.getName(), level);
}

代码示例来源:origin: ChestShop-authors/ChestShop-3

@Override
public Result filter(org.apache.logging.log4j.core.Logger logger, Level level, Marker marker, Message msg, Throwable t) {
  return filter(logger.getName(), level);
}

代码示例来源:origin: Waikato/wekaDeeplearning4j

/**
 * Update the weka dl4j log level.
 */
protected void updateWekaDl4jLogLevel() {
  LoggerContext context = getLoggerContext();
  Collection<Logger> loggers = context.getLoggers();
  for (Logger logger : loggers) {
    if (logger.getName().startsWith("weka")) {
      updateLogLevel(logger.getName(), wekaDl4jLogLevel);
    }
  }
}

代码示例来源:origin: org.apache.logging.log4j/log4j-1.2-api

public final Category getParent() {
  final org.apache.logging.log4j.core.Logger parent = logger.getParent();
  if (parent == null) {
    return null;
  }
  final ConcurrentMap<String, Logger> loggers = getLoggersMap(logger.getContext());
  final Logger l = loggers.get(parent.getName());
  return l == null ? new Category(parent) : l;
}

代码示例来源:origin: org.apache.logging.log4j.adapters/log4j-1.2-api

public final Category getParent() {
  final org.apache.logging.log4j.core.Logger parent = logger.getParent();
  if (parent == null) {
    return null;
  }
  final ConcurrentMap<String, Logger> loggers = getLoggersMap(logger.getContext());
  final Logger l = loggers.get(parent.getName());
  return l == null ? new Category(parent) : l;
}

代码示例来源:origin: org.apache.logging.log4j/log4j12-api

public final Category getParent() {
  org.apache.logging.log4j.core.Logger parent = logger.getParent();
  if (parent == null) {
    return null;
  }
  ConcurrentMap<String, Logger> loggers = getLoggersMap(logger.getContext());
  Logger l = loggers.get(parent.getName());
  return l == null ? new Category(parent) : l;
}

代码示例来源:origin: ops4j/org.ops4j.pax.logging

public PrivateConfig(final Configuration config, final Logger logger) {
  this.config = config;
  this.loggerConfig = config.getLoggerConfig(getName());
  this.loggerConfigLevel = this.loggerConfig.getLevel();
  this.intLevel = this.loggerConfigLevel.intLevel();
  this.logger = logger;
}

代码示例来源:origin: ops4j/org.ops4j.pax.logging

@Override
public void logMessage(final String fqcn, final Level level, final Marker marker, final Message message,
    final Throwable t) {
  final Message msg = message == null ? new SimpleMessage(Strings.EMPTY) : message;
  final ReliabilityStrategy strategy = privateConfig.loggerConfig.getReliabilityStrategy();
  strategy.log(this, getName(), fqcn, marker, level, msg, t);
}

代码示例来源:origin: org.apache.geode/gemfire-core

public LoggerConfig getLoggerConfig() {
 final Logger logger = getLogger();
 final LoggerContext context = logger.getContext();
 return context.getConfiguration().getLoggerConfig(logger.getName());
}

代码示例来源:origin: com.alibaba.nacos/nacos-client

@Override
public void setLevel(Level level) {
  this.level = level;
  org.apache.logging.log4j.Level l = org.apache.logging.log4j.Level.toLevel(level.getName(),
    org.apache.logging.log4j.Level.ERROR);
  logger.setLevel(l);
  logger.getContext().getConfiguration().getLoggerConfig(this.logger.getName()).setLevel(l);
}

代码示例来源:origin: com.taobao.middleware/logger.core

@Override
public void setLevel(Level level) {
  this.level = level;
  org.apache.logging.log4j.Level l = org.apache.logging.log4j.Level.toLevel(level.getName(), org.apache.logging.log4j.Level.ERROR);
  logger.setLevel(l);
  logger.getContext().getConfiguration().getLoggerConfig(this.logger.getName()).setLevel(l);
}

代码示例来源:origin: com.alibaba.edas.acm/acm-sdk

@Override
public void setLevel(Level level) {
  this.level = level;
  org.apache.logging.log4j.Level l = org.apache.logging.log4j.Level.toLevel(level.getName(), org.apache.logging.log4j.Level.ERROR);
  logger.setLevel(l);
  logger.getContext().getConfiguration().getLoggerConfig(this.logger.getName()).setLevel(l);
}

相关文章