/** * Format and publish a <tt>LogRecord</tt>. * * @param record description of the log event. A null record is silently ignored and is not * published */ public synchronized void publish(LogRecord record) { if (!isLoggable(record)) { return; } super.publish(record); flush(); }
@Override public synchronized void publish(LogRecord record) { if (!isLoggable(record)) { return; } checkRotate(); super.publish(record); super.flush(); }
private void checkRotate() { if (rotate) { String newFilename = calculateFilename(); if (!filename.equals(newFilename)) { filename = newFilename; // note that the console handler doesn't see this message super.publish(new LogRecord(Level.INFO, "Log rotating to: " + filename)); updateOutput(); } } }