Add comment explaining log file reopening for rotation support (#956)

This commit is contained in:
Ping Xie 2024-08-27 21:00:17 -07:00 committed by Madelyn Olson
parent 856d5d1b06
commit dea55a53a8

View File

@ -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;