private void closeCurrentFileChannel() {
        try {
            channel.force(true);
        } catch (IOException e) {
            InternalLogger.INSTANCE.error("Caught an error while forcing updates to be written: "
                    + currentFile.path(), e);
        }
        try {
            channel.close();
        } catch (Exception e) {
            InternalLogger.INSTANCE.error("Caught an error while closing the file channel: "
                    + currentFile.path(), e);
        }
    }
Note that it is fine to close file channel and open a new one not atomically because there is
always only one thread will call roll() and append()
turms-server-common/src/main/java/im/turms/server/common/infra/logging/core/appender/file/RollingFileAppender.java