summaryrefslogtreecommitdiffstats
path: root/src/Root.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Root.cpp')
-rw-r--r--src/Root.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/Root.cpp b/src/Root.cpp
index c10bd09bd..a487310a8 100644
--- a/src/Root.cpp
+++ b/src/Root.cpp
@@ -116,14 +116,19 @@ void cRoot::Start(std::unique_ptr<cSettingsRepositoryInterface> a_OverridesRepo)
auto consoleLogListener = MakeConsoleListener(m_RunAsService);
auto consoleAttachment = cLogger::GetInstance().AttachListener(std::move(consoleLogListener));
- auto fileLogListenerRet = MakeFileListener();
- if (!fileLogListenerRet.first)
+
+ cLogger::cAttachment fileAttachment;
+ if (!a_OverridesRepo->HasValue("Server","DisableLogFile"))
{
- m_TerminateEventRaised = true;
- LOGERROR("Failed to open log file, aborting");
- return;
+ auto fileLogListenerRet = MakeFileListener();
+ if (!fileLogListenerRet.first)
+ {
+ m_TerminateEventRaised = true;
+ LOGERROR("Failed to open log file, aborting");
+ return;
+ }
+ fileAttachment = cLogger::GetInstance().AttachListener(std::move(fileLogListenerRet.second));
}
- auto fileAttachment = cLogger::GetInstance().AttachListener(std::move(fileLogListenerRet.second));
LOG("--- Started Log ---");