Browse - Programming Tips - Apache: write a debug message to the error log

Date: 2019apr16
Product: Apache

Q.  Apache: write a debug message to the error log

A.  You can use the LogMessage.

Make sure to find LogLevel (probably in your http.conf)
and set it to info (or more verbose)

LogLevel info
Uncomment the log_debug module (in http.conf)
LoadModule log_debug_module modules/mod_log_debug.so
Then you can use LogMessage in your own .conf files, eg:
LogMessage "hello world"
Restart Apache. It can do fancier tricks, eg:
<Location "/here"> LogMessage "cookie=%{HTTP_COOKIE}" </Location>
More info https://httpd.apache.org/docs/2.4/mod/mod_log_debug.html