}
}
-int serviceMain(int argc, char**argv)
+int serviceMain(int argc, char*argv[])
{
L.setName("pdns_recursor");
serviceMain(argc, argv);
#else
doWindowsServiceArguments(service);
+ L.toNTLog();
RecursorService::instance()->start( argc, argv, ::arg().mustDo( "ntservice" ));
#endif
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
#include "utility.hh"
#include "logger.hh"
-
+#include "ntservice.hh"
+#include "pdnsmsg.hh"
using namespace std;
Logger &theL(const string &pname)
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<<" " <<msg << endl;
return;
void Logger::toNTLog( void )
{
-
+ m_eventLogHandle = RegisterEventSource( NULL,
+ NTService::instance()->getServiceName().c_str());
}
void Logger::open()