From: Bert Hubert Date: Sun, 18 Nov 2012 19:13:31 +0000 (+0000) Subject: if you really want to run the json interface to the recursor, you can now do so by... X-Git-Tag: auth-3.2-rc2~97 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f3d1d67bfd317094de6c6ee1538d5e36843e59f8;p=pdns if you really want to run the json interface to the recursor, you can now do so by setting 'json-interface'. git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2904 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/json_ws.cc b/pdns/json_ws.cc index 91c56525d..5210cab6b 100644 --- a/pdns/json_ws.cc +++ b/pdns/json_ws.cc @@ -129,7 +129,7 @@ void JWebserver::readRequest(int fd) content += returnJSONObject(stats); } else if(varmap["command"]=="log-grep") { - content += makeLogGrepJSON(varmap, "/var/log/pdns.log", " pdns_recursor["); + content += makeLogGrepJSON(varmap, ::arg()["logfile"], " pdns_recursor["); } else { // if(varmap["command"] == "stats") { stats = getAllStatsMap(); diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index cb1527ea3..479f80f80 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -26,7 +26,7 @@ #endif // WIN32 #include - +#include "json_ws.hh" #include #include "recpacketcache.hh" #include "utility.hh" @@ -1832,8 +1832,13 @@ try PacketID pident; t_fdm=getMultiplexer(); - if(!t_id) + if(!t_id) { + if(::arg().mustDo("json-interface")) { + L<getName() << "' multiplexer"<addReadFD(g_pipes[t_id].readToThread, handlePipeRequest); @@ -1968,8 +1973,9 @@ int main(int argc, char **argv) ::arg().setSwitch( "ntservice", "Run as service" )= "no"; ::arg().setSwitch( "use-ntlog", "Use the NT logging facilities" )= "yes"; ::arg().setSwitch( "use-logfile", "Use a log file" )= "no"; - ::arg().setSwitch( "logfile", "Filename of the log file" )= "recursor.log"; #else + ::arg().set( "logfile", "Filename of the log file for JSON parser" )= "/var/log/pdns.log"; + ::arg().setSwitch( "json-interface", "If we should run a JSON webserver") = "no"; ::arg().set("quiet","Suppress logging of questions and answers")=""; ::arg().set("logging-facility","Facility to log messages as. 0 corresponds to local0")=""; #endif