Does make-file-logger guarantee log persistence during abrupt process termination?
0 reputation · 31 Jul 2021, 04:30 UTC
Log Buffering in racket/log
When utilizing make-file-logger to capture deployment diagnostics, the underlying port employs default buffering. This means log entries are written to disk only when the buffer fills, the program terminates normally, or an explicit flush is triggered.
In scenarios where a deployment fails due to an uncaught exception or a runtime crash, there is a risk that the final, most critical error messages remain in the buffer and are never written to the file. While setting the buffering mode to 'line or manually calling logger-flush can mitigate this, these options may impact performance in high-throughput environments.
Which configuration provides the best balance between performance and reliability for post-mortem analysis? Does Racket provide a mechanism to ensure the final log buffer is flushed specifically during a fatal runtime crash without manual flushing after every call?