From 6d6cc807930329bee14fab780a4a211537abfa2c Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Tue, 15 Mar 2016 21:27:37 +0200 Subject: [PATCH] Added flushing of all logs to disk when MaxScale exits It is possible that messages logged immediately before exiting are not flushed to disk. Flushing all logs before exiting from the main function guarantees that any relevant log messages are flushed to disk. --- server/core/gateway.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/core/gateway.c b/server/core/gateway.c index 006bcbcf0..1e74ae951 100644 --- a/server/core/gateway.c +++ b/server/core/gateway.c @@ -2007,6 +2007,8 @@ int main(int argc, char **argv) return_main: + mxs_log_flush_sync(); + if (daemon_mode && rc != MAXSCALE_SHUTDOWN) { /** Notify the parent process that an error has occurred */