How to disable Apache and nginx log files for domains?




  • Avatar
    Nikolay Zhmuk

    @Noam Harel Hello, it is not recommended since it potentially can cause Plesk malfunction. Also, those files will be recreated during DailyMaintenance task execution that includes log rotation.

  • Avatar
    Dan Wright

    That all seems pretty complicated. Is that all any different than just entering into the "Additional directives for HTTP/HTTPS" the following?

    ErrorLog /dev/null
    CustomLog /dev/null common

    Works for me :)

  • Avatar
    Noam Harel


    erasing the files fom domain log files and system folder might work?


  • Avatar
    A Sieber (Edited )

    After disabling nginx log-files for a specific domain as described above, nginx will produce many log entries in /var/log/nginx/access.log.

    Before that, only a few entries have been written there. It looks like the log entries are now written to the general log instead of the access.log files in the domains. That's not what I want.




  • Avatar
    Ivan Postnikov

    Hello @Dan,

    The resolution from the article allows applying this configuration change to multiple or all domains.

    It would be great if you could clarify which exact steps have you found difficult to do?

  • Avatar
    Bulat Tsydenov

    @A Sieber, the behavior you are describing is expected because the article describes how to disable logs for domains only. If you want to disable nginx logs at all on the whole server, apply the solution from this article and create `/etc/nginx/conf.d/00_disable_logs.conf` file with the following configuration:

    access_log off;
    error_log off;

    After that, restart nginx service

Please sign in to leave a comment.

Have more questions? Submit a request