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)); } } }
/** * 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)); } } }
/** * Checks that requires parameters are set and if everything is in order, * activates this appender. */ public void start() { int errors = 0; if (this.encoder == null) { addStatus(new ErrorStatus("No encoder set for the appender named \"" + name + "\".", this)); errors++; } if (this.outputStream == null) { addStatus(new ErrorStatus( "No output stream set for the appender named \"" + name + "\".", this)); errors++; } // only error free appenders should be activated if (errors == 0) { super.start(); } }
addStatus(new ErrorStatus("IO failure in appender", this, ioe));
/** * 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)); } } }
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)); } } }
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)); } } }
void encoderClose() { if (encoder != null && this.outputStream != null) { try { byte[] footer = encoder.footerBytes(); writeBytes(footer); } catch (IOException ioe) { this.started = false; addStatus(new ErrorStatus("Failed to write footer for appender named [" + name + "].", this, ioe)); } } }
void encoderInit() { if (encoder != null && this.outputStream != null) { try { byte[] header = encoder.headerBytes(); writeBytes(header); } catch (IOException ioe) { this.started = false; addStatus(new ErrorStatus("Failed to initialize encoder for appender named [" + name + "].", this, ioe)); } } } protected void writeOut(E event) throws IOException {
void encoderClose() { if (encoder != null && this.outputStream != null) { try { byte[] footer = encoder.footerBytes(); writeBytes(footer); } catch (IOException ioe) { this.started = false; addStatus(new ErrorStatus("Failed to write footer for appender named [" + name + "].", this, ioe)); } } }
void encoderClose() { if (encoder != null && this.outputStream != null) { try { byte[] footer = encoder.footerBytes(); writeBytes(footer); } catch (IOException ioe) { this.started = false; addStatus(new ErrorStatus("Failed to write footer for appender named [" + name + "].", this, ioe)); } } }
void encoderClose() { if (encoder != null && this.outputStream != null) { try { byte[] footer = encoder.footerBytes(); writeBytes(footer); } catch (IOException ioe) { this.started = false; addStatus(new ErrorStatus("Failed to write footer for appender named [" + name + "].", this, ioe)); } } }
void encoderInit() { if (encoder != null && this.outputStream != null) { try { byte[] header = encoder.headerBytes(); writeBytes(header); } catch (IOException ioe) { this.started = false; addStatus(new ErrorStatus("Failed to initialize encoder for appender named [" + name + "].", this, ioe)); } } } protected void writeOut(E event) throws IOException {
void encoderInit() { if (encoder != null && this.outputStream != null) { try { byte[] header = encoder.headerBytes(); writeBytes(header); } catch (IOException ioe) { this.started = false; addStatus(new ErrorStatus("Failed to initialize encoder for appender named [" + name + "].", this, ioe)); } } } protected void writeOut(E event) throws IOException {
void encoderInit() { if (encoder != null && this.outputStream != null) { try { byte[] header = encoder.headerBytes(); writeBytes(header); } catch (IOException ioe) { this.started = false; addStatus(new ErrorStatus( "Failed to initialize encoder for appender named [" + name + "].", this, ioe)); } } }