org.apache.logging.log4j.core.config.Configuration.getLoggerContext()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(191)

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

Configuration.getLoggerContext介绍

[英]Gets the logger context.
[中]获取记录器上下文。

代码示例

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

@Test
public void testConfigurationLoggerContext() throws Exception {
  final Configuration configuration = this.ctx.getConfiguration();
  assertThat(configuration.getLoggerContext(), is(notNullValue()));
}

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

/**
 * Gets the LoggerContext from the Configuration or null.
 * 
 * @return the LoggerContext from the Configuration or null.
 */
public LoggerContext getLoggerContext() {
  return configuration != null ? configuration.getLoggerContext() : null;
}

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

@Deprecated
public static KafkaAppender createAppender(
    final Layout<? extends Serializable> layout,
    final Filter filter,
    final String name,
    final boolean ignoreExceptions,
    final String topic,
    final Property[] properties,
    final Configuration configuration) {
  if (layout == null) {
    AbstractLifeCycle.LOGGER.error("No layout provided for KafkaAppender");
    return null;
  }
  final KafkaManager kafkaManager = new KafkaManager(configuration.getLoggerContext(), name, topic, true, properties);
  return new KafkaAppender(name, layout, filter, ignoreExceptions, kafkaManager);
}

代码示例来源:origin: com.vlkan.log4j2/log4j2-redis-appender

private ObjectName createJmxBeanName() {
  String beanName = firstNonNull(
      config.getJmxBeanName(),
      String.format(
          "org.apache.logging.log4j2:type=%s,component=Appenders,name=%s,subtype=RedisThrottler",
          appender.getConfig().getLoggerContext().getName(),
          appender.getName()));
  try {
    return new ObjectName(beanName);
  } catch (MalformedObjectNameException error) {
    String message = String.format("malformed JMX bean name (beanName=%s)", beanName);
    throw new RuntimeException(message, error);
  }
}

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

@SuppressWarnings("resource")
@Override
public KafkaAppender build() {
  final Layout<? extends Serializable> layout = getLayout();
  if (layout == null) {
    AbstractLifeCycle.LOGGER.error("No layout provided for KafkaAppender");
    return null;
  }
  final KafkaManager kafkaManager = new KafkaManager(getConfiguration().getLoggerContext(), getName(), topic, syncSend, properties);
  return new KafkaAppender(getName(), layout, getFilter(), isIgnoreExceptions(), kafkaManager);
}

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

@Override
public HttpAppender build() {
  final HttpManager httpManager = new HttpURLConnectionManager(getConfiguration(), getConfiguration().getLoggerContext(),
    getName(), url, method, connectTimeoutMillis, readTimeoutMillis, headers, sslConfiguration, verifyHostname);
  return new HttpAppender(getName(), getLayout(), getFilter(), isIgnoreExceptions(), httpManager);
}

代码示例来源:origin: spring-projects/spring-amqp

theLayout = PatternLayout.createDefaultLayout();
AmqpManager manager = new AmqpManager(configuration.getLoggerContext(), name);
manager.uri = uri;
manager.host = host;

代码示例来源:origin: org.springframework.amqp/spring-rabbit

theLayout = PatternLayout.createDefaultLayout();
AmqpManager manager = new AmqpManager(configuration.getLoggerContext(), name);
manager.uri = uri;
manager.host = host;

相关文章