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 GitHub
parent 744b13e302
commit 2b71a78241
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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;