How to enable non-error Apache log on MAMP

Posted on

How to enable non-error Apache log on MAMP – Problems with loading a website are often blamed on the Internet connection, but even the most perfectly set up network cannot help if there is no service to reply at your destination. One of the most popular HTTP servers used for this task is Apache2. Much of Apache’s popularity can be attributed to its easy installation and use, but never the less it is possible to run into problems with even the easiest of the software. If you’ve encountered an issue loading your web page, follow these simple troubleshooting methods outlined in this guide to attempt to get your web server back up and working again. Below are some tips in manage your apache2 server when you find problem about apache-2.2, log-files, mamp, , .

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.)

I found the answer here:

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.

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

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

All is explained at Use LogFormat to define a format, CustomLog to define a location.

Leave a Reply

Your email address will not be published.