From 0de681be5d5b51dc8b33c69bb28473bf8617fd2c Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Thu, 7 Feb 2013 18:34:50 +0100 Subject: [PATCH] Compat: implemented log_path config getter (no functionality yet) fixes #2796 --- components/compat/compatcomponent.cpp | 14 ++++++++++++++ components/compat/compatcomponent.h | 1 + 2 files changed, 15 insertions(+) diff --git a/components/compat/compatcomponent.cpp b/components/compat/compatcomponent.cpp index 4b294c70f..3a24bc770 100644 --- a/components/compat/compatcomponent.cpp +++ b/components/compat/compatcomponent.cpp @@ -55,6 +55,20 @@ String CompatComponent::GetObjectsPath(void) const return objectsPath; } +/** + * Retrieves the log path. + * + * @returns log path + */ +String CompatComponent::GetLogPath(void) const +{ + Value logPath = GetConfig()->Get("log_path"); + if (logPath.IsEmpty()) + return Application::GetLocalStateDir() + "/log/icinga2/compat"; + else + return logPath; +} + /** * Retrieves the icinga.cmd path. * diff --git a/components/compat/compatcomponent.h b/components/compat/compatcomponent.h index 3ca730c1d..94458e40c 100644 --- a/components/compat/compatcomponent.h +++ b/components/compat/compatcomponent.h @@ -44,6 +44,7 @@ private: String GetStatusPath(void) const; String GetObjectsPath(void) const; + String GetLogPath(void) const; String GetCommandPath(void) const; void DumpDowntimes(ofstream& fp, const DynamicObject::Ptr& owner); -- 2.40.0