mirror of https://github.com/Icinga/icinga2.git
Add the HTTP request body to debug log
This commit is contained in:
parent
9ea51aa86e
commit
36cea68c1a
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include "remote/httputility.hpp"
|
||||
#include "base/json.hpp"
|
||||
#include "base/logger.hpp"
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
using namespace icinga;
|
||||
|
@ -34,8 +35,13 @@ Dictionary::Ptr HttpUtility::FetchRequestParameters(HttpRequest& request)
|
|||
while ((count = request.ReadBody(buffer, sizeof(buffer))) > 0)
|
||||
body += String(buffer, buffer + count);
|
||||
|
||||
if (!body.IsEmpty())
|
||||
if (!body.IsEmpty()) {
|
||||
#ifdef I2_DEBUG
|
||||
Log(LogDebug, "HttpUtility")
|
||||
<< "Request body: '" << body << "'";
|
||||
#endif /* I2_DEBUG */
|
||||
result = JsonDecode(body);
|
||||
}
|
||||
|
||||
if (!result)
|
||||
result = new Dictionary();
|
||||
|
|
Loading…
Reference in New Issue