Removes the beauty of the JSON logging

The beautify options makes the JSON easy to be read by human eyes.
No need to have pretty print JSON for production, as beautify the JSON
is not a hard task. Atop of that there are some disvantages to use the
JSON in pretty format, as described on the issue: #1472
This commit is contained in:
David Buckle 2017-06-27 08:21:30 -03:00 committed by Felipe Zimmerle
parent 1edd3570e1
commit d465c2f1a3
2 changed files with 4 additions and 2 deletions

View File

@ -221,7 +221,7 @@ int ModSecurity::processContentOffset(const char *content, size_t len,
return -1;
}
yajl_gen_config(g, yajl_gen_beautify, 1);
yajl_gen_config(g, yajl_gen_beautify, 0);
yajl_gen_map_open(g);
yajl_gen_string(g, reinterpret_cast<const unsigned char*>("match"),
@ -367,6 +367,7 @@ int ModSecurity::processContentOffset(const char *content, size_t len,
yajl_gen_get_buf(g, &buf, &jsonSize);
json->assign(reinterpret_cast<const char*>(buf), jsonSize);
json->append("\n");
yajl_gen_free(g);
#else

View File

@ -1486,7 +1486,7 @@ std::string Transaction::toJSON(int parts) {
if (g == NULL) {
return "";
}
yajl_gen_config(g, yajl_gen_beautify, 1);
yajl_gen_config(g, yajl_gen_beautify, 0);
/* main */
yajl_gen_map_open(g);
@ -1654,6 +1654,7 @@ std::string Transaction::toJSON(int parts) {
yajl_gen_get_buf(g, &buf, &len);
log.assign(reinterpret_cast<const char*>(buf), len);
log.append("\n");
yajl_gen_free(g);