X
X
Worldwide (English) GBP 0

Welcome

Sign in

Managing Linux Server Error Logs Safely and Reducing Disk Usage

HomepageArticlesManaging Linux Server Error Logs Safely and Re...
Server hardware and hosting dashboard
Illustrative image · HostTurka

Originally published: 2016-10-03

Technical update: 22 October 2026. Disabling error logs to solve a full disk can remove the evidence needed to diagnose failures or security incidents. The archived advice to comment out ErrorLog has been removed; that is not a reliable method of disabling Apache logging either.

Identify the growing log first

Apache access logs, Apache error logs, PHP error logs and application logs serve different purposes. Do not assume that every failed HTTP request is written to the same error file. Identify the active configuration and path, then investigate repeated software errors or unwanted traffic. The Apache logging guide distinguishes access and error records.

Use rotation and a retention policy

Rotate logs by time or size and define retention and access permissions. Deleting a file while a service is still writing to it may not reclaim space as expected. Preserve required incident evidence first and verify the logging mechanism used on your server.

On cPanel/WHM systems, use the Apache configuration and Log Rotation interfaces supported by your version instead of directly editing generated httpd.conf files. Menus and paths can vary. The cPanel Apache Configuration documentation lists the supported interfaces.

Hiding PHP errors is different from disabling logs

In production, display_errors can remain off while log_errors remains on for diagnosis. Check the effective configuration used by the web runtime: CLI and web/FPM may use different settings. The PHP error-configuration reference defines these settings separately.

When should capacity increase?

Fix repeated errors and establish retention first. If normal workloads exceed capacity, assess resources for a cloud server or dedicated server. Keep passwords, access keys and unnecessary personal data out of logs. For archives and recovery, confirm the scope and retention of backup solutions separately.

ABOUT THE AUTHOR

Computer Programmer | Hostturka

A 2009 Kadir Has University graduate and owner of CND Medya, working in hosting, server administration, networking and web software.

Education, projects and professional background →

Copyright © 2026 All Rights Reserved
Top