public synchronized void flush() { if (msgWriter != null) { try { msgWriter.flush(); } catch (IOException e) { reportError("Failed to flush writer", e, ErrorManager.FLUSH_FAILURE); } } }
public synchronized void flush() { if (msgWriter != null) { try { msgWriter.flush(); } catch (IOException e) { reportError("Failed to flush writer", e, ErrorManager.FLUSH_FAILURE); } } }
public synchronized void flush() { if (msgWriter != null) { try { msgWriter.flush(); } catch (IOException e) { reportError("Failed to flush writer", e, ErrorManager.FLUSH_FAILURE); } } }
public synchronized void close() { if (msgWriter != null) { try { if (!wroteHeader) { msgWriter.write(getFormatter().getHead(this)); wroteHeader = true; } msgWriter.write(getFormatter().getTail(this)); msgWriter.flush(); msgWriter.close(); } catch (Exception ex) { // We don't want to throw an exception here, but we // report the exception to any registered ErrorManager. reportError(null, ex, ErrorManager.CLOSE_FAILURE); } msgWriter = null; msgOutput = null; } }
public synchronized void close() { if (msgWriter != null) { try { if (!wroteHeader) { msgWriter.write(getFormatter().getHead(this)); wroteHeader = true; } msgWriter.write(getFormatter().getTail(this)); msgWriter.flush(); msgWriter.close(); } catch (Exception ex) { // We don't want to throw an exception here, but we // report the exception to any registered ErrorManager. reportError(null, ex, ErrorManager.CLOSE_FAILURE); } msgWriter = null; msgOutput = null; } }
public synchronized void close() { if (msgWriter != null) { try { if (!wroteHeader) { msgWriter.write(getFormatter().getHead(this)); wroteHeader = true; } msgWriter.write(getFormatter().getTail(this)); msgWriter.flush(); msgWriter.close(); } catch (Exception ex) { // We don't want to throw an exception here, but we // report the exception to any registered ErrorManager. reportError(null, ex, ErrorManager.CLOSE_FAILURE); } msgWriter = null; msgOutput = null; } }
/** * Actual writing occurs here. * Most subclasses of WriterHandler will need to * override this method. */ protected void subPublish(LogRecord record) { Formatter fmt = getFormatter(); String msg = fmt.format(record); synchronized (this) { try { msgWriter.write(msg); } catch (IOException e) { reportError("Failed to publish recored", e, ErrorManager.WRITE_FAILURE); } if (this.immediateFlush) { flush(); } } }
/** * Actual writing occurs here. * Most subclasses of WriterHandler will need to * override this method. * @param record */ protected void subPublish(LogRecord record) { Formatter fmt = getFormatter(); String msg = fmt.format(record); synchronized (this) { try { msgWriter.write(msg); } catch (IOException e) { reportError("Failed to publish recored", e, ErrorManager.WRITE_FAILURE); } if (this.immediateFlush) { flush(); } } }
/** * Actual writing occurs here. * Most subclasses of WriterHandler will need to * override this method. */ protected void subPublish(LogRecord record) { Formatter fmt = getFormatter(); String msg = fmt.format(record); synchronized (this) { try { msgWriter.write(msg); } catch (IOException e) { reportError("Failed to publish recored", e, ErrorManager.WRITE_FAILURE); } if (this.immediateFlush) { flush(); } } }