Skip to content

Commit

Permalink
Add comment explaining log file reopening for rotation support (valke…
Browse files Browse the repository at this point in the history
  • Loading branch information
PingXie authored Aug 28, 2024
1 parent 744b13e commit 2b71a78
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ void serverLogRaw(int level, const char *msg) {
level &= 0xff; /* clear flags */
if (level < server.verbosity) return;

/* We open and close the log file in every call to support log rotation.
* This allows external processes to move or truncate the log file without
* disrupting logging. */
fp = log_to_stdout ? stdout : fopen(server.logfile, "a");
if (!fp) return;

Expand Down

0 comments on commit 2b71a78

Please sign in to comment.