diff --git a/core/java/src/net/i2p/util/LogWriter.java b/core/java/src/net/i2p/util/LogWriter.java index 51108e18b..c141cc243 100644 --- a/core/java/src/net/i2p/util/LogWriter.java +++ b/core/java/src/net/i2p/util/LogWriter.java @@ -77,7 +77,8 @@ class LogWriter implements Runnable { writeRecord(rec); } try { - _currentOut.flush(); + if (_currentOut != null) + _currentOut.flush(); } catch (IOException ioe) { if (++_diskFullMessageCount < MAX_DISKFULL_MESSAGES) System.err.println("Error writing the router log - disk full? " + ioe); @@ -180,7 +181,8 @@ class LogWriter implements Runnable { try { _currentOut = new BufferedWriter(new OutputStreamWriter(new SecureFileOutputStream(f), "UTF-8")); } catch (IOException ioe) { - System.err.println("Error rotating into [" + f.getAbsolutePath() + "]" + ioe); + if (++_diskFullMessageCount < MAX_DISKFULL_MESSAGES) + System.err.println("Error creating log file [" + f.getAbsolutePath() + "]" + ioe); } }