ch.qos.logback.core.joran.GenericConfigurator.doConfigure()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(129)

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

GenericConfigurator.doConfigure介绍

[英]Configures logback with the configuration XML read from a given file
[中]使用从给定文件读取的配置XML配置日志

代码示例

代码示例来源:origin: camunda/camunda-bpm-platform

public void doConfigure(final List<SaxEvent> eventList) throws JoranException {
 super.doConfigure(eventList);
}

代码示例来源:origin: camunda/camunda-bpm-platform

public final void doConfigure(String filename) throws JoranException {
 doConfigure(new File(filename));
}

代码示例来源:origin: camunda/camunda-bpm-platform

public final void doConfigure(InputStream inputStream) throws JoranException {
 doConfigure(new InputSource(inputStream));
}

代码示例来源:origin: camunda/camunda-bpm-platform

public final void doConfigure(File file) throws JoranException {
 FileInputStream fis = null;
 try {
  informContextOfURLUsedForConfiguration(getContext(), file.toURI().toURL());
  fis = new FileInputStream(file);
  doConfigure(fis);
 } catch (IOException ioe) {
  String errMsg = "Could not open [" + file.getPath() + "].";
  addError(errMsg, ioe);
  throw new JoranException(errMsg, ioe);
 } finally {
  if (fis != null) {
   try {
    fis.close();
   } catch (java.io.IOException ioe) {
    String errMsg = "Could not close [" + file.getName() + "].";
    addError(errMsg, ioe);
    throw new JoranException(errMsg, ioe);
   }
  }
 }
}

代码示例来源:origin: camunda/camunda-bpm-platform

public final void doConfigure(URL url) throws JoranException {
 InputStream in = null;
 try {
  informContextOfURLUsedForConfiguration(getContext(), url);
  URLConnection urlConnection = url.openConnection();
  // per http://jira.qos.ch/browse/LBCORE-105
  // per http://jira.qos.ch/browse/LBCORE-127
  urlConnection.setUseCaches(false);
  in = urlConnection.getInputStream();
  doConfigure(in);
 } catch (IOException ioe) {
  String errMsg = "Could not open URL [" + url + "].";
  addError(errMsg, ioe);
  throw new JoranException(errMsg, ioe);
 } finally {
  if (in != null) {
   try {
    in.close();
   } catch (IOException ioe) {
    String errMsg = "Could not close input stream";
    addError(errMsg, ioe);
    throw new JoranException(errMsg, ioe);
   }
  }
 }
}

代码示例来源:origin: camunda/camunda-bpm-platform

public final void doConfigure(final InputSource inputSource)
    throws JoranException {
 long threshold = System.currentTimeMillis();
 if (!ConfigurationWatchListUtil.wasConfigurationWatchListReset(context)) {
  informContextOfURLUsedForConfiguration(getContext(), null);
 }
 SaxEventRecorder recorder = new SaxEventRecorder(context);
 recorder.recordEvents(inputSource);
 doConfigure(recorder.saxEventList);
 // no exceptions a this level
 StatusUtil statusUtil = new StatusUtil(context);
 if (statusUtil.noXMLParsingErrorsOccurred(threshold)) {
  addInfo("Registering current configuration as safe fallback point");
  registerSafeConfiguration();
 }
}

代码示例来源:origin: ch.qos.logback/core

public void doConfigure(final List<SaxEvent> eventList) throws JoranException {
  super.doConfigure(eventList);
 }
}

代码示例来源:origin: tony19/logback-android

public void doConfigure(final List<SaxEvent> eventList) throws JoranException {
 super.doConfigure(eventList);
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

public void doConfigure(final List<SaxEvent> eventList) throws JoranException {
  super.doConfigure(eventList);
}

代码示例来源:origin: com.hynnet/logback-core

public void doConfigure(final List<SaxEvent> eventList) throws JoranException {
 super.doConfigure(eventList);
}

代码示例来源:origin: tony19/logback-android

/**
 * Configures logback with the configuration XML read from a file,
 * located at the given path on the host filesystem
 *
 * @param filename path to the file, containing the configuration XML
 * @throws JoranException configuration error occurred
 */
public final void doConfigure(String filename) throws JoranException {
 doConfigure(new File(filename));
}

代码示例来源:origin: ch.qos.logback/core

public final void doConfigure(InputStream inputStream) throws JoranException {
 doConfigure(new InputSource(inputStream));
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

public final void doConfigure(String filename) throws JoranException {
  doConfigure(new File(filename));
}

代码示例来源:origin: com.hynnet/logback-core

public final void doConfigure(InputStream inputStream) throws JoranException {
 doConfigure(new InputSource(inputStream));
}

代码示例来源:origin: tony19/logback-android

public final void doConfigure(InputStream inputStream, String systemId) throws JoranException {
 InputSource inputSource = new InputSource(inputStream);
 inputSource.setSystemId(systemId);
 doConfigure(inputSource);
}

代码示例来源:origin: Nextdoor/bender

public final void doConfigure(InputStream inputStream, String systemId) throws JoranException {
  InputSource inputSource = new InputSource(inputStream);
  inputSource.setSystemId(systemId);
  doConfigure(inputSource);
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

public final void doConfigure(InputStream inputStream, String systemId) throws JoranException {
  InputSource inputSource = new InputSource(inputStream);
  inputSource.setSystemId(systemId);
  doConfigure(inputSource);
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

public final void doConfigure(InputStream inputStream, String systemId) throws JoranException {
  InputSource inputSource = new InputSource(inputStream);
  inputSource.setSystemId(systemId);
  doConfigure(inputSource);
}

代码示例来源:origin: com.github.robozonky/robozonky-cli

@Override
  public void configure(final LoggerContext loggerContext) {
    try {
      configurator.setContext(loggerContext);
      loggerContext.reset();
      configurator.doConfigure(getClass().getResource("/logback.xml"));
    } catch (final Exception ex) { // this is a critical error, no debugging == no means of helping users
      throw new IllegalStateException("Failed reading Logback configuration.", ex);
    }
  }
}

代码示例来源:origin: RoboZonky/robozonky

@Override
  public void configure(final LoggerContext loggerContext) {
    try {
      configurator.setContext(loggerContext);
      loggerContext.reset();
      configurator.doConfigure(getClass().getResource("/logback.xml"));
    } catch (final Exception ex) { // this is a critical error, no debugging == no means of helping users
      throw new IllegalStateException("Failed reading Logback configuration.", ex);
    }
  }
}

相关文章