From 6ba3193d5f2f4ebcc2978bf73b53016a03290f50 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Mon, 24 Jul 2017 11:03:52 +0300 Subject: [PATCH] MXS-1322 When flushing the log file, it will not be truncated Earlier when the log file was flushed, it was also truncated, which meant that the log content was log, unless the file first was moved. Now it will only be opened. Thus, no data can be lost due to the operation. If logrotate it used, the end result will be the same, as the file is moved first. --- server/core/log_manager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/core/log_manager.cc b/server/core/log_manager.cc index f2764d143..4e0ca9fd2 100644 --- a/server/core/log_manager.cc +++ b/server/core/log_manager.cc @@ -2147,7 +2147,7 @@ static bool thr_flush_file(logmanager_t *lm, filewriter_t *fwr) skygw_file_close(fwr->fwr_file); fwr->fwr_file = NULL; - if (!logfile_open_file(fwr, lf, SKYGW_OPEN_TRUNCATE, log_config.do_maxlog)) + if (!logfile_open_file(fwr, lf, SKYGW_OPEN_APPEND, log_config.do_maxlog)) { LOG_ERROR("MaxScale Log: Error, could not re-open log file %s.\n", lf->lf_full_file_name);