本文整理了Java中ch.qos.logback.core.joran.GenericConfigurator.addError()
方法的一些代码示例,展示了GenericConfigurator.addError()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GenericConfigurator.addError()
方法的具体详情如下:
包路径:ch.qos.logback.core.joran.GenericConfigurator
类名称:GenericConfigurator
方法名:addError
暂无
代码示例来源: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: tony19/logback-android
/**
* Configures logback with the configuraiton XML read from an input stream,
* and then closes the stream
*
* @param inputStream stream to contents of configuration XML
* @throws JoranException configuration error occurred
*/
public final void doConfigure(InputStream inputStream) throws JoranException {
try {
doConfigure(new InputSource(inputStream));
} finally {
try {
inputStream.close();
} catch (IOException ioe) {
String errMsg = "Could not close the stream";
addError(errMsg, ioe);
throw new JoranException(errMsg, ioe);
}
}
}
代码示例来源:origin: com.alibaba.citrus.tool/antx-autoexpand
final public void doConfigure(URL url) throws JoranException {
try {
informContextOfURLUsedForConfiguration(url);
URLConnection urlConnection = url.openConnection();
// per http://jira.qos.ch/browse/LBCORE-105
// per http://jira.qos.ch/browse/LBCORE-127
urlConnection.setUseCaches(false);
InputStream in = urlConnection.getInputStream();
doConfigure(in);
in.close();
} catch (IOException ioe) {
String errMsg = "Could not open URL [" + url + "].";
addError(errMsg, ioe);
throw new JoranException(errMsg, ioe);
}
}
代码示例来源:origin: com.alibaba.citrus.tool/antx-autoexpand
final public void doConfigure(File file) throws JoranException {
FileInputStream fis = null;
try {
informContextOfURLUsedForConfiguration(file.toURI().toURL());
fis = new FileInputStream(file);
doConfigure(fis);
} catch (IOException ioe) {
String errMsg = "Could not open [" + file.getName() + "].";
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: com.impetus.fabric/fabric-jdbc-driver-shaded
public final void doConfigure(File file) throws JoranException {
FileInputStream fis = null;
try {
URL url = file.toURI().toURL();
informContextOfURLUsedForConfiguration(getContext(), url);
fis = new FileInputStream(file);
doConfigure(fis, url.toExternalForm());
} 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: at.bestsolution.efxclipse.eclipse/ch.qos.logback.core
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: io.virtdata/virtdata-lib-realer
public final void doConfigure(File file) throws JoranException {
FileInputStream fis = null;
try {
URL url = file.toURI().toURL();
informContextOfURLUsedForConfiguration(getContext(), url);
fis = new FileInputStream(file);
doConfigure(fis, url.toExternalForm());
} 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: ch.qos.logback/core
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: com.hynnet/logback-core
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: Nextdoor/bender
public final void doConfigure(File file) throws JoranException {
FileInputStream fis = null;
try {
URL url = file.toURI().toURL();
informContextOfURLUsedForConfiguration(getContext(), url);
fis = new FileInputStream(file);
doConfigure(fis, url.toExternalForm());
} 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: io.virtdata/virtdata-lib-realer
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, url.toExternalForm());
} 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: com.hynnet/logback-core
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: ch.qos.logback/core
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: at.bestsolution.efxclipse.eclipse/ch.qos.logback.core
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: com.impetus.fabric/fabric-jdbc-driver-shaded
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, url.toExternalForm());
} 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: Nextdoor/bender
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, url.toExternalForm());
} 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: tony19/logback-android
/**
* Configures logback with the configuration XML read from a given file
*
* @param file the file, containing the configuration XML
* @throws JoranException configuration error occurred
*/
public final void doConfigure(File file) throws JoranException {
FileInputStream fis = null;
try {
URL url = file.toURI().toURL();
informContextOfURLUsedForConfiguration(getContext(), url);
fis = new FileInputStream(file);
// this closes the stream for us
doConfigure(fis, url.toExternalForm());
} catch (IOException ioe) {
String errMsg = "Could not open [" + file.getPath() + "].";
addError(errMsg, ioe);
throw new JoranException(errMsg, ioe);
} finally {
CloseUtil.closeQuietly(fis);
}
}
代码示例来源:origin: tony19/logback-android
/**
* Configures logback with the configuration XML read from a file,
* located at the given URL
*
* @param url URL to the file, containing the configuration XML
* @throws JoranException configuration error occurred
*/
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);
// this closes the stream for us
in = urlConnection.getInputStream();
doConfigure(in, url.toExternalForm());
} catch (IOException ioe) {
String errMsg = "Could not open URL [" + url + "].";
addError(errMsg, ioe);
throw new JoranException(errMsg, ioe);
} finally {
CloseUtil.closeQuietly(in);
}
}
内容来源于网络,如有侵权,请联系作者删除!