/** * Creates a rotating file logger that logs the messages to files in the default directory. * * @throws FileNotFoundException if the current file cannot be opened or created. */ protected RotatingFileLogger() throws FileNotFoundException { super(getCurrentFile()); this.currentDate = new Date(); Files.directory.register((configuration, oldFile, newFile) -> rotate()); }
/** * Rotates the log file. */ @Impure private void rotate() { this.currentDate = new Date(); try { setFile(getCurrentFile()); } catch (@Nonnull FileNotFoundException exception) { throw UncheckedExceptionBuilder.withCause(exception).build(); } }