7
votes

How can I enable non-error server logging on MAMP (or, am I totally blind, and is it already enabled by default?)

So far, I can only find the error logs for Apache, MySQL and PHP in /Applications/MAMP/logs. But I'd like to access the server log (ie, the rawest data that the server processes, all of the HTTP requests that it received/served, etc.)

3 Answers 3

10
votes

I found the answer here: https://documentation.mamp.info/en/MAMP-Mac/FAQ/#where-can-i-find-the-log-files

All log files are stored in: /Applications/MAMP/logs/

The logs need to be enabled on Apache.
In the file /Applications/MAMP/conf/apache/https.conf find the lines

#CustomLog logs/access_log combined

Please uncomment this line by removing the '#', if you do it Apache will write the access logs into /Applications/MAMP/Library/logs/access_log.
It may not be what you want, if you want to get the access logs in the same directory as the others logs (/Applications/MAMP/logs/) use the absolute path to the file:

CustomLog /Applications/MAMP/logs/apache_access_log combined

combined is a log format, that you can find on a line LogFormat

About logs, please note that you can also configure the error logs and the log level.

ErrorLog "/Applications/MAMP/logs/apache_error.log"
LogLevel error

After doing this, restart your MAMP Apache server.

0
3
votes

I had success with adding this to the "Additional parameters for <VirtualHost>"

CustomLog "/Applications/MAMP/logs/mySiteName_access.log" combined

1
  • This line works fine and is an override of the CustomLog present in /Applications/MAMP/conf/apache/httpd.conf.
    – Anthony
    May 18, 2018 at 13:30
1
vote

All is explained at http://httpd.apache.org/docs/2.2/mod/mod_log_config.html Use LogFormat to define a format, CustomLog to define a location.

You must log in to answer this question.