aboutsummaryrefslogtreecommitdiff
path: root/src/configreader.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-01-18 03:10:47 +0000
committerGravatar Sadie Powell2022-05-01 22:07:04 +0100
commitc382faf9c941ad2ab93f806b6477933d41566719 (patch)
tree9244cf84190cf74d4e16085b2ae9bc9b5520457f /src/configreader.cpp
parentDelete the old logging system. (diff)
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.
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r--src/configreader.cpp13
1 files changed, 11 insertions, 2 deletions
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.");