/**
* The PrintWriter to which we are currently logging, if any.
*/
- private PrintWriter writer = null;
+ private volatile PrintWriter writer = null;
/**
* Log buffer size
}
try {
+ PrintWriter writer = this.writer;
if (writer!=null) {
writer.write(result);
} else {
protected void closeWriter() {
try {
+ PrintWriter writer = this.writer;
+ this.writer = null;
if (writer == null)
return;
writer.write(getFormatter().getTail(this));
public void flush() {
try {
+ PrintWriter writer = this.writer;
+ if (writer==null)
+ return;
writer.flush();
} catch (Exception e) {
reportError(null, e, ErrorManager.FLUSH_FAILURE);