Apache: Issue with Creating Domain-Specific Error Log Files

Hi,

I’m having trouble getting the error log files to be created with my domain name. Currently, the access_log and error_log files are generated in the logs folder, but they aren’t named after my domain (e.g., mrt.com-error_log).

Here’s my http-vhost.conf configuration:

<VirtualHost *:80>
    ServerAdmin webmaster@mrt.com
    DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/My-project"
    ServerName mrt.com
    ErrorLog "/Applications/XAMPP/xamppfiles/logs/mrt.com-error_log"
    CustomLog "/Applications/XAMPP/xamppfiles/logs/mrt.com-access_log" common
</VirtualHost>

I’ve also added ServerName mrt.com in the httpd.conf file and added the domain to my hosts file, but the error logs still don’t get created with the domain name.

Here’s my hosts file configuration:

127.0.0.1    localhost
255.255.255.255    broadcasthost
127.0.0.1    mrt.com
::1    localhost

I’m running this setup on macOS.

Any help on how to resolve this issue would be appreciated!

Thanks!