From c382faf9c941ad2ab93f806b6477933d41566719 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 18 Jan 2022 03:10:47 +0000 Subject: Rewrite the entire logging system. - Much cleaner API for writing to the log. - Adds support for stderr and stdout logging to the core. - Adds support for sql and syslog logging in modules. --- src/configreader.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/configreader.cpp') diff --git a/src/configreader.cpp b/src/configreader.cpp index 8abcb0279..d5b7364ef 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -670,8 +670,17 @@ void ConfigReaderThread::OnStop() // The description of this server may have changed - update it for WHOIS etc. ServerInstance->FakeClient->server->description = Config->ServerDesc; - ServerInstance->Logs.CloseLogs(); - ServerInstance->Logs.OpenFileLogs(); + try + { + ServerInstance->Logs.CloseLogs(); + ServerInstance->Logs.OpenLogs(true); + } + catch (CoreException& ex) + { + ServerInstance->Logs.Normal("LOG", "Cannot open log files: " + ex.GetReason()); + if (user) + user->WriteNotice("Cannot open log files: " + ex.GetReason()); + } if (Config->RawLog && !old->RawLog) ServerInstance->Users.ServerNoticeAll("*** Raw I/O logging is enabled on this server. All messages, passwords, and commands are being recorded."); -- cgit v1.3.1-10-gc9f91