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

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

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

Configuration.getConfigurationSource介绍

[英]Returns the source of this configuration.
[中]返回此配置的源。

代码示例

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

@Override
public String getConfigurationInfo() {
 return getConfiguration().getConfigurationSource().toString();
}

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

@VisibleForTesting
static String getConfigurationInfoString() {
 return getConfiguration().getConfigurationSource().toString();
}

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

@Before
public void setup() throws URISyntaxException, MalformedURLException {
  ContextAnchor.THREAD_CONTEXT.set(mockCtx);
  given(config.getConfigurationSource()).willReturn(configSrc);
  given(configSrc.getFile()).willReturn(EXPECT);
}

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

@Before
public void setup() throws URISyntaxException {
  ContextAnchor.THREAD_CONTEXT.set(mockCtx);
  given(config.getConfigurationSource()).willReturn(configSrc);
  given(configSrc.getFile()).willReturn(EXPECT);
}

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

public static String getConfigurationSourceLocation(final Configuration config) {
 return config.getConfigurationSource().getLocation();
}

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

@Override
public String getConfigText(final String charsetName) throws IOException {
  try {
    final ConfigurationSource source = loggerContext.getConfiguration().getConfigurationSource();
    final ConfigurationSource copy = source.resetInputStream();
    final Charset charset = Charset.forName(charsetName);
    return readContents(copy.getInputStream(), charset);
  } catch (final Exception ex) {
    final StringWriter sw = new StringWriter(BUFFER_SIZE);
    ex.printStackTrace(new PrintWriter(sw));
    return sw.toString();
  }
}

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

public static String getConfigInformation() {
 return getConfiguration().getConfigurationSource().toString();
}

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

/**
 * Reconfigures the context.
 */
private void reconfigure(final URI configURI) {
  final ClassLoader cl = ClassLoader.class.isInstance(externalContext) ? (ClassLoader) externalContext : null;
  LOGGER.debug("Reconfiguration started for context[name={}] at URI {} ({}) with optional ClassLoader: {}",
      contextName, configURI, this, cl);
  final Configuration instance = ConfigurationFactory.getInstance().getConfiguration(this, contextName, configURI, cl);
  if (instance == null) {
    LOGGER.error("Reconfiguration failed: No configuration found for '{}' at '{}' in '{}'", contextName, configURI, cl);
  } else {
    setConfiguration(instance);
    /*
     * instance.start(); Configuration old = setConfiguration(instance); updateLoggers(); if (old != null) {
     * old.stop(); }
     */
    final String location = configuration == null ? "?" : String.valueOf(configuration.getConfigurationSource());
    LOGGER.debug("Reconfiguration complete for context[name={}] at URI {} ({}) with optional ClassLoader: {}",
        contextName, location, this, cl);
  }
}

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

@Override
public String lookup(final LogEvent event, final String key) {
  if (configuration != null) {
    final ConfigurationSource configSrc = configuration.getConfigurationSource();
    final File file = configSrc.getFile();
    if (file != null) {

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

LoggerContext context = getLoggerContext();
Configuration config = context.getConfiguration();
ConfigurationSource configSource = config.getConfigurationSource();
String packageHomeDir = WekaPackageManager.getPackageHome().getPath();
if (ConfigurationSource.NULL_SOURCE.equals(configSource)) {

相关文章