Sometimes, it is ideal to have logs for each virtual host. It would be a great deal when debugging applications or just seeing the logs available for your virtual host.

Create Logs for Your Virtual Host

To create a custom log for your Virtual Host, directives should be placed within a <VirtualHost> section.

<VirtualHost *:80>
    DocumentRoot /var/www/example
    ErrorLog     logs/
    CustomLog   logs/ combined

Now, when you need to access the logs, you will find them in /var/logs/httpd/ and /var/logs/httpd/ rather than the default log files.