Skip to content

feat: add RollingFileAppender::flush for durable log writes - #316

Open
victoriacampbellmake wants to merge 3 commits into
SergiusTheBest:masterfrom
victoriacampbellmake:feat/rolling-file-flush-233
Open

feat: add RollingFileAppender::flush for durable log writes#316
victoriacampbellmake wants to merge 3 commits into
SergiusTheBest:masterfrom
victoriacampbellmake:feat/rolling-file-flush-233

Conversation

@victoriacampbellmake

Copy link
Copy Markdown

Summary

Adds RollingFileAppender::flush() so callers can push OS/libc file buffers to disk without rolling or truncating logs (#233).

  • util::File::flush() uses _commit on Windows and fsync on POSIX
  • RollingFileAppender::flush() takes the appender lock and flushes the open log file
  • Documented under RollingFileAppender in the README

This matches the backup / cross-process visibility use case discussed in the issue: flush durable bytes without calling rollLogFiles().

Test plan

  • Log a few lines, call flush(), confirm another process sees the latest content
  • Confirm flush() does not rename/remove log files
  • Existing rolling behavior unchanged when flush() is unused

Closes #233

Signed-off-by: victoriacampbellmake <victoriacampbellmake@users.noreply.github.com>
Signed-off-by: victoriacampbellmake <victoriacampbellmake@users.noreply.github.com>
Signed-off-by: victoriacampbellmake <victoriacampbellmake@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding possibility for force flushing current file buffer

1 participant