The answers above work great for the default apache that comes pre-installed on the mac. In my case, I'm using Apache (on High Sierrra) installed via Homebrew. Here's the procedure I used to locate my error log:
>ps -ef |grep httpd
This gives an output with lines like this:
502 10587 10586 0 11:11AM ?? 0:00.00 /usr/local/opt/httpd/bin/httpd -k start
That gives you the location of the httpd executable. Now run:
Substituting in the location of your httpd executable. You'll get something like this (shortened)
Server compiled with....
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
So the "DEFAULT_ERRORLOG" is in
logs/error_log - but relative to what?
Now open the "SERVER_CONFIG_FILE"
There, I found two entries that might be helpful:
So in some cases the DEFAULT_ERRORLOG might be relative to ServerRoot. In my case though, there was an ErrorLog explicitly specified (second line) and that's where my errors are going.