public void setEncoding(String encoding) throws SecurityException, UnsupportedEncodingException { super.setEncoding(encoding); if (msgOutput == null) { return; } // Replace the current writer with a writer for the new encoding. flush(); if (encoding == null) { msgWriter = new OutputStreamWriter(msgOutput); } else { msgWriter = new OutputStreamWriter(msgOutput, encoding); } }
public void setEncoding(String encoding) throws SecurityException, UnsupportedEncodingException { super.setEncoding(encoding); if (msgOutput == null) { return; } // Replace the current writer with a writer for the new encoding. flush(); if (encoding == null) { msgWriter = new OutputStreamWriter(msgOutput); } else { msgWriter = new OutputStreamWriter(msgOutput, encoding); } }
public void setEncoding(String encoding) throws SecurityException, UnsupportedEncodingException { super.setEncoding(encoding); if (msgOutput == null) { return; } // Replace the current writer with a writer for the new encoding. flush(); if (encoding == null) { msgWriter = new OutputStreamWriter(msgOutput); } else { msgWriter = new OutputStreamWriter(msgOutput, encoding); } }
/** * 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. */ 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(); } } }