]> granicus.if.org Git - icinga2/commitdiff
Compat: implemented log_path config getter (no functionality yet)
authorMichael Friedrich <michael.friedrich@netways.de>
Thu, 7 Feb 2013 17:34:50 +0000 (18:34 +0100)
committerMichael Friedrich <michael.friedrich@netways.de>
Thu, 7 Feb 2013 17:34:50 +0000 (18:34 +0100)
fixes #2796

components/compat/compatcomponent.cpp
components/compat/compatcomponent.h

index 4b294c70fc416f72566f7d9b470c70d591887613..3a24bc77016e576bd2525ae69631baeccc168aeb 100644 (file)
@@ -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.
  *
index 3ca730c1dbd3633066fa0cd7f95b2e2abc5ba228..94458e40cecc62c1b85c3b68281ab1a7a37da7a4 100644 (file)
@@ -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);