From fd99e84551a7787b90aea7335ee6600c4f6aeab9 Mon Sep 17 00:00:00 2001 From: Christian Hofstaedtler Date: Mon, 24 Feb 2014 13:54:59 +0100 Subject: [PATCH] REST API: take config-name into account in search-log --- pdns/ws-api.cc | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/pdns/ws-api.cc b/pdns/ws-api.cc index d47dd1e6d6..7fe9590735 100644 --- a/pdns/ws-api.cc +++ b/pdns/ws-api.cc @@ -33,6 +33,8 @@ #include #include +extern string s_programname; + #ifndef HAVE_STRCASESTR /* @@ -185,15 +187,7 @@ void apiServerSearchLog(HttpRequest* req, HttpResponse* resp) { if(req->method != "GET") throw HttpMethodNotAllowedException(); - string prefix; - switch (versionGetProduct()) { - case ProductAuthoritative: - prefix = " pdns["; - break; - case ProductRecursor: - prefix = " pdns_recursor["; - break; - } + string prefix = " " + s_programname + "["; resp->body = logGrep(req->parameters["q"], ::arg()["experimental-logfile"], prefix); } -- 2.47.2