diff --git a/base/base.vcxproj b/base/base.vcxproj index 26fbe3feb..bc3bbccb8 100644 --- a/base/base.vcxproj +++ b/base/base.vcxproj @@ -18,11 +18,14 @@ + + + @@ -40,6 +43,7 @@ + @@ -48,6 +52,8 @@ + + diff --git a/base/base.vcxproj.filters b/base/base.vcxproj.filters index f27667d74..47b1ba4fd 100644 --- a/base/base.vcxproj.filters +++ b/base/base.vcxproj.filters @@ -67,6 +67,15 @@ Quelldateien + + Quelldateien + + + Quelldateien + + + Quelldateien + @@ -138,6 +147,15 @@ Headerdateien + + Headerdateien + + + Headerdateien + + + Headerdateien + diff --git a/base/streamlogger.h b/base/streamlogger.h index 8da1a6bca..9a90538c2 100644 --- a/base/streamlogger.h +++ b/base/streamlogger.h @@ -7,7 +7,7 @@ namespace icinga /** * A logger that logs to stdout. */ -class StreamLogger : public Logger +class I2_BASE_API StreamLogger : public Logger { public: typedef shared_ptr Ptr; diff --git a/base/sysloglogger.cpp b/base/sysloglogger.cpp index 8b9e79c59..06dc19733 100644 --- a/base/sysloglogger.cpp +++ b/base/sysloglogger.cpp @@ -1,3 +1,4 @@ +#ifndef _WIN32 #include "i2-base.h" using namespace icinga; @@ -40,3 +41,4 @@ void SyslogLogger::ProcessLogEntry(const LogEntry& entry) syslog(severity | LOG_USER, "%s", entry.Message.c_str()); } +#endif /* _WIN32 */ \ No newline at end of file diff --git a/base/sysloglogger.h b/base/sysloglogger.h index 0c9b64821..5433ae8d4 100644 --- a/base/sysloglogger.h +++ b/base/sysloglogger.h @@ -1,13 +1,14 @@ #ifndef SYSLOGLOGGER_H #define SYSLOGLOGGER_H +#ifndef _WIN32 namespace icinga { /** * A logger that logs to syslog. */ -class SyslogLogger : public Logger +class I2_BASE_API SyslogLogger : public Logger { public: typedef shared_ptr Ptr; @@ -20,5 +21,6 @@ protected: }; } +#endif /* _WIN32 */ #endif /* SYSLOGLOGGER_H */ diff --git a/icinga/icingaapplication.cpp b/icinga/icingaapplication.cpp index 7bc829b85..7be913310 100644 --- a/icinga/icingaapplication.cpp +++ b/icinga/icingaapplication.cpp @@ -103,8 +103,12 @@ int IcingaApplication::Main(const vector& args) throw invalid_argument("No config file was specified on the command line."); if (enableSyslog) { +#ifndef _WIN32 SyslogLogger::Ptr syslogLogger = boost::make_shared(LogInformation); Logger::RegisterLogger(syslogLogger); +#else /* _WIN32 */ + throw invalid_argument("Syslog is not supported on Windows."); +#endif /* _WIN32 */ } string componentDirectory = Utility::DirName(GetExePath()) + "/../lib/icinga2";