code: @Override
      public synchronized void shutdown() {
          try {
              if (open) {
                  open = false;
                  writer.close();
                  logFile.renameTo(new File(fileName));
              }
          } catch (IOException e) {
              logger.error("Error shutting down", e);
          }
      }
docs: On the first call to this method, close the log file and rename it. Set
  the flag so no more logging calls will be accepted.