aboutsummaryrefslogtreecommitdiff
path: root/src/server/worldserver/Main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/worldserver/Main.cpp')
-rw-r--r--src/server/worldserver/Main.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp
index b3d97d7884c..50ed59a22a1 100644
--- a/src/server/worldserver/Main.cpp
+++ b/src/server/worldserver/Main.cpp
@@ -48,6 +48,7 @@
#include "WorldSocket.h"
#include "WorldSocketMgr.h"
#include "DatabaseLoader.h"
+#include "AppenderDB.h"
using namespace boost::program_options;
@@ -120,11 +121,9 @@ extern int main(int argc, char** argv)
return 1;
}
- if (sConfigMgr->GetBoolDefault("Log.Async.Enable", false))
- {
- // If logs are supposed to be handled async then we need to pass the io_service into the Log singleton
- Log::instance(&_ioService);
- }
+ sLog->RegisterAppender<AppenderDB>();
+ // If logs are supposed to be handled async then we need to pass the io_service into the Log singleton
+ sLog->Initialize(sConfigMgr->GetBoolDefault("Log.Async.Enable", false) ? &_ioService : nullptr);
TC_LOG_INFO("server.worldserver", "%s (worldserver-daemon)", _FULLVERSION);
TC_LOG_INFO("server.worldserver", "<Ctrl-C> to stop.\n");