fix (core/logging/conf): Fix Logging for Modules (#11601)

* fix (core/logging/conf): Fix Logging for Modules

Fix custom module logging and appender. Also included Logging Async Conf.

* Update Log.cpp

* Core/Logging: Force synchronous logging after io_service shutdown - fixes logging on worldserver shutdown

https: //github.com/TrinityCore/TrinityCore/commit/c71987b1a1403fa20654cc24b37448ca807ff363
Co-Authored-By: Shauren <shauren.trinity@gmail.com>

Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
acidmanifesto
2022-05-19 09:54:08 -04:00
committed by GitHub
parent c5368816fa
commit 76d57065e2
7 changed files with 58 additions and 12 deletions

View File

@@ -199,7 +199,8 @@ int main(int argc, char** argv)
// Init all logs
sLog->RegisterAppender<AppenderDB>();
sLog->Initialize();
// If logs are supposed to be handled async then we need to pass the IoContext into the Log singleton
sLog->Initialize(sConfigMgr->GetOption<bool>("Log.Async.Enable", false) ? ioContext.get() : nullptr);
Acore::Banner::Show("worldserver-daemon",
[](std::string_view text)
@@ -421,6 +422,8 @@ int main(int argc, char** argv)
// Shutdown starts here
threadPool.reset();
sLog->SetSynchronous();
sScriptMgr->OnShutdown();
// set server offline

View File

@@ -3914,6 +3914,16 @@ Logger.module=4,Console Server
#Logger.vehicles=4,Console Server
#Logger.warden=4,Console Server
#Logger.weather=4,Console Server
#
# Log.Async.Enable
# Description: Enables asynchronous message logging.
# Default: 0 - (Disabled)
# 1 - (Enabled)
Log.Async.Enable = 0
#
###################################################################################################
###################################################################################################