Use standard httpd logging format in error log#3192
Use standard httpd logging format in error log#3192airween merged 5 commits intoowasp-modsecurity:v2/masterfrom marcstern:v2/pr/errorlog
Conversation
[client %s] is added by the standard httpd log function => remove it
|
Is there a way to actually test this change? |
|
Sounds good, but I'm with @fzipi. From the code it's not clear what the output will be. Does the |
Yes, same logic: useragent_ip if present, client_ip otherwise |
|
Code from httpd log.c |
|
That's good. But a test that asserts the log format would be even better. |
|
I added some tests |
|
Thanks, that's great. @airween, isn't there a test suite for ModSecurity where the test could be added? |
Unfortunately no, there isn't. We have only this CI: And as @marcstern wrote, he added a test (but I'm not sure that's what we expect - I'm waiting for Marc's answer). But as I introduced few weeks ago, there is MRTS, where the aim is to create a full covered test suite. Feel free to review and contribute! 😄 |
…++ assertions. See https://www.gnu.org/software/libc/manual/html_node/Source-Fortification.html & https://gcc.gnu.org/wiki/LibstdcxxDebugMode _GLIBCXX_ASSERTIONS is probably useless as we have pure C here, but let's define it in case some checks are included (or will be in a future version). As we handle some requests here, that may help to trap a problem.
|



All credits to @arminabf - see #1997
Use the server context, like in all other places to use standard httpd format.
Remark: We previously had a mix; some entries were using the standard httpd format, some not.
Entries using the standard httpd format had the [client] field duplicated.
In this PR, we use standard logging for all lines and remove the duplicated field.
Actual changes: