[icinga-checkins] icinga.org: icinga2/master: Compat: implemented log_path config getter ( no functionality yet)

git at icinga.org git at icinga.org
Thu Feb 7 18:34:57 CET 2013


Module: icinga2
Branch: master
Commit: 0de681be5d5b51dc8b33c69bb28473bf8617fd2c
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=0de681be5d5b51dc8b33c69bb28473bf8617fd2c

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Thu Feb  7 18:34:50 2013 +0100

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(+), 0 deletions(-)

diff --git a/components/compat/compatcomponent.cpp b/components/compat/compatcomponent.cpp
index 4b294c7..3a24bc7 100644
--- a/components/compat/compatcomponent.cpp
+++ b/components/compat/compatcomponent.cpp
@@ -56,6 +56,20 @@ String CompatComponent::GetObjectsPath(void) const
 }
 
 /**
+ * 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.
  *
  * @returns icinga.cmd path
diff --git a/components/compat/compatcomponent.h b/components/compat/compatcomponent.h
index 3ca730c..94458e4 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);





More information about the icinga-checkins mailing list