diff --git a/lib/ProxySQL_Admin.cpp b/lib/ProxySQL_Admin.cpp index 465131247..af6b7bb87 100644 --- a/lib/ProxySQL_Admin.cpp +++ b/lib/ProxySQL_Admin.cpp @@ -1117,6 +1117,7 @@ void ProxySQL_Admin::flush_logs() { } free(ssl_keylog_file); } + proxy_debug(PROXY_DEBUG_ADMIN, 1, "Running PROXYSQL FLUSH LOGS\n"); } diff --git a/lib/debug.cpp b/lib/debug.cpp index 483d04efe..440ef8024 100644 --- a/lib/debug.cpp +++ b/lib/debug.cpp @@ -43,7 +43,7 @@ struct DebugLogEntry { std::string backtrace; }; -static const size_t limitSize = 30; +static const size_t limitSize = 100; static std::vector log_buffer = {}; @@ -285,7 +285,11 @@ void proxy_debug_func( // but the entries can be read in `log_buffer` in the core dump // note2: also in case of shutdown , `log_buffer` will have entries that won't be saved. // if we really want *all* entries, we could just call sync_log_buffer_to_disk() on shutdown - if (log_buffer.size() > limitSize) { + if ( + (log_buffer.size() >= limitSize) + || + (entry.file == "ProxySQL_Admin.cpp" && entry.funct == "flush_logs") + ) { sync_log_buffer_to_disk(db); } }