From: Bert Hubert Date: Sun, 30 Apr 2006 15:29:11 +0000 (+0000) Subject: more logging && service fixes X-Git-Tag: rec-3.1.2~48 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6424093e5a738c6edee920d7b766a974372d44b5;p=pdns more logging && service fixes git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@816 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 38b5cd1c8..d68b45325 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1273,7 +1273,7 @@ void parseAuthAndForwards() } } -int serviceMain(int argc, char**argv) +int serviceMain(int argc, char*argv[]) { L.setName("pdns_recursor"); @@ -1556,6 +1556,7 @@ int main(int argc, char **argv) serviceMain(argc, argv); #else doWindowsServiceArguments(service); + L.toNTLog(); RecursorService::instance()->start( argc, argv, ::arg().mustDo( "ntservice" )); #endif diff --git a/pdns/recursorservice.cc b/pdns/recursorservice.cc index 6f95e95f9..d16d9191a 100644 --- a/pdns/recursorservice.cc +++ b/pdns/recursorservice.cc @@ -6,7 +6,6 @@ it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation - This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/pdns/win32_logger.cc b/pdns/win32_logger.cc index 9f38afff5..d7cbe6034 100644 --- a/pdns/win32_logger.cc +++ b/pdns/win32_logger.cc @@ -19,7 +19,8 @@ #include "utility.hh" #include "logger.hh" - +#include "ntservice.hh" +#include "pdnsmsg.hh" using namespace std; Logger &theL(const string &pname) @@ -48,6 +49,8 @@ void Logger::log(const string &msg, Urgency u) fwrite( message.str().c_str(), sizeof( char ), message.str().length(), m_pLogFile ); fflush( m_pLogFile ); } + if(m_eventLogHandle) + ReportEvent( m_eventLogHandle, u, 0, MSG_WARNING, NULL, 1, 0, tmp, NULL ); clog << timestr<<" " <getServiceName().c_str()); } void Logger::open()