mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
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:
parent
1edd3570e1
commit
d465c2f1a3
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user