public static void addError(String msg, Object o, Throwable t) { addStatus(new ErrorStatus(msg, o, t)); }
public static void addError(String msg, Object o) { addStatus(new ErrorStatus(msg, o)); }
private static void addError(LoggerContext context, Object origin, String msg, Throwable t) { StatusManager sm = context.getStatusManager(); if (sm == null) { return; } sm.add(new ErrorStatus(msg, origin, t)); }
addError("Exception thrown for evaluator named [" + ee.getName() + "]", eex); } else if (errorCount == MAX_ERROR_COUNT) { ErrorStatus errorStatus = new ErrorStatus("Exception thrown for evaluator named [" + ee.getName() + "].", this, eex); errorStatus.add(new ErrorStatus("This was the last warning about this evaluator's errors." + "We don't want the StatusManager to get flooded.", this)); addStatus(errorStatus);
public void configureByResource(URL url) throws JoranException { if (url == null) { throw new IllegalArgumentException("URL argument cannot be null"); } final String urlString = url.toString(); if (urlString.endsWith("groovy")) { if (EnvUtil.isGroovyAvailable()) { // avoid directly referring to GafferConfigurator so as to avoid // loading groovy.lang.GroovyObject . See also http://jira.qos.ch/browse/LBCLASSIC-214 GafferUtil.runGafferConfiguratorOn(loggerContext, this, url); } else { StatusManager sm = loggerContext.getStatusManager(); sm.add(new ErrorStatus("Groovy classes are not available on the class path. ABORTING INITIALIZATION.", loggerContext)); } } else if (urlString.endsWith("xml")) { JoranConfigurator configurator = new JoranConfigurator(); configurator.setContext(loggerContext); configurator.doConfigure(url); } else { throw new LogbackException("Unexpected filename extension of file [" + url.toString() + "]. Should be either .groovy or .xml"); } }
private void multiplicityWarning(String resourceName, ClassLoader classLoader) { Set<URL> urlSet = null; StatusManager sm = loggerContext.getStatusManager(); try { urlSet = Loader.getResources(resourceName, classLoader); } catch (IOException e) { sm.add(new ErrorStatus("Failed to get url list for resource [" + resourceName + "]", loggerContext, e)); } if (urlSet != null && urlSet.size() > 1) { sm.add(new WarnStatus("Resource [" + resourceName + "] occurs multiple times on the classpath.", loggerContext)); for (URL url : urlSet) { sm.add(new WarnStatus("Resource [" + resourceName + "] occurs at [" + url.toString() + "]", loggerContext)); } } } }
addError("Exception thrown for evaluator named [" + ee.getName() + "]", eex); } else if (errorCount == CoreConstants.MAX_ERROR_COUNT) { ErrorStatus errorStatus = new ErrorStatus("Exception thrown for evaluator named [" + ee.getName() + "].", this, eex); errorStatus.add(new ErrorStatus("This was the last warning about this evaluator's errors." + "We don't want the StatusManager to get flooded.", this)); addStatus(errorStatus);
addStatus(new ErrorStatus("IO failure in appender", this, ioe));
/** * Options are activated and become effective only after calling this method. */ public void start() { int errors = 0; if (this.layout == null) { addStatus(new ErrorStatus("No layout set for the RocketmqLogbackAppender named \"" + name + "\".", this)); errors++; } if (errors > 0 || !checkEntryConditions()) { return; } try { producer = ProducerInstance.getProducerInstance().getInstance(nameServerAddress, producerGroup); } catch (Exception e) { addError("Starting RocketmqLogbackAppender [" + this.getName() + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage()); } if (producer != null) { super.start(); } }
public void addError(Object caller, String msg, Throwable t) { addStatus(new ErrorStatus(msg, caller, t)); }
private static void addError(LoggerContext context, Object origin, String msg, Throwable t) { StatusManager sm = context.getStatusManager(); if (sm == null) { return; } sm.add(new ErrorStatus(msg, origin, t)); }
/** * Close the underlying {@link OutputStream}. */ protected void closeOutputStream() { if (this.outputStream != null) { try { // before closing we have to output out layout's footer encoderClose(); this.outputStream.close(); this.outputStream = null; } catch (IOException e) { addStatus(new ErrorStatus( "Could not close output stream for OutputStreamAppender.", this, e)); } } }
void encoderInit() { if (encoder != null && this.outputStream != null) { try { encoder.init(outputStream); } catch (IOException ioe) { this.started = false; addStatus(new ErrorStatus( "Failed to initialize encoder for appender named [" + name + "].", this, ioe)); } } }
void encoderClose() { if (encoder != null && this.outputStream != null) { try { encoder.close(); } catch (IOException ioe) { this.started = false; addStatus(new ErrorStatus("Failed to write footer for appender named [" + name + "].", this, ioe)); } } }
public void addError(String msg, Throwable ex) { addStatus(new ErrorStatus(msg, getDeclaredOrigin(), ex)); } }
public void addError(String msg, Throwable ex) { addStatus(new ErrorStatus(msg, getOrigin(), ex)); }
public void addError(String msg) { addStatus(new ErrorStatus(msg, getDeclaredOrigin())); }
public void addError(String msg) { addStatus(new ErrorStatus(msg, getOrigin())); }
void postIOFailure(IOException e) { addStatusIfCountNotOverLimit(new ErrorStatus("IO failure while writing to " + getDescription(), this, e)); presumedClean = false; if (recoveryCoordinator == null) { recoveryCoordinator = new RecoveryCoordinator(); } }
void attemptRecovery() { try { close(); } catch (IOException e) { } addStatusIfCountNotOverLimit(new InfoStatus( "Attempting to recover from IO failure on " + getDescription(), this)); // subsequent writes must always be in append mode try { os = openNewOutputStream(); presumedClean = true; } catch (IOException e) { addStatusIfCountNotOverLimit(new ErrorStatus("Failed to open " + getDescription(), this, e)); } }