code: @SuppressForbidden(reason = "Could not do this without reflection")
      public static void rolloverLogfile() {
          Logger log = Logger.getLogger("");    // NOSONAR - local logger used on purpose here
          for (Handler handler : log.getHandlers()) {
              if(handler instanceof FileHandler) {
                  try {
                      Method m = FileHandler.class.getDeclaredMethod("rotate");
                      m.setAccessible(true);
                      if (!Level.OFF.equals(handler.getLevel())) { //Assume not closed.
                              m.invoke(handler);
                      }
                  } catch (IllegalAccessException | IllegalArgumentException |
                          InvocationTargetException | NoSuchMethodException | SecurityException e) {
                      throw new IllegalStateException(e);
                  }
              }
          }
  
  	}
docs: Resort to reflection to make any FileHandler that is currently active roll-over
  the current logfile and start a new one, e.g. this may be useful before a big
  batch-job starts to have a clean start of log-entries.
  
  @throws IllegalStateException If there is a problem calling the rotate-method of the {@link FileHandler}