https://github.com/JuliaLogging/LoggingExtras.jl/blob/d35e7c8cfc197853ee336ace17182e6ed36dca24/src/Sinks/filelogger.jl#L19-L20 Perhaps `atexit(() -> close(io))` would be appropriate? I have not seen any bugs from the current implementation, but I do worry one could lose logs when `always_flush=false`.