The /usr/local/cpanel/bin/splitlogs binary boosts your resources and performance when you create Apache logs. For example, the /usr/local/cpanel/bin/splitlogs binary can close a file without restarting Apache. Splitlogs Binary improves log processing and bandwidth processing performance.
The default behavior of Apache is to open and write either on a byte log file and an access log file for every virtual host in its configuration file. Due to this, the count of open log files equals twice the count of virtual hosts in Apache’s /usr/local/apache/conf/httpd.conf file. Now in order to decrease Apache’s memory consumption, cPanel & WHM uses Apache’s piped logs functionality with the splitlogs binary to process Apache log data. The splitlogs binary only opens and writes to a single log file when a visitor accesses a virtual host. Now cPanel & WHM runs two occurrences of the splitlogs binary: One to manage the byte log files, and the other to manage the access log files.
The splitlogs binary basically extracts the domain name and port from the Apache logs, and uses this information as a space-separated line in the log file. This information concludes the log file’s name, which the system writes to either a specified directory, or to the default location for Apache logs in the /usr/local/apache/ directory.
In order to request the splitlogs binary from the command line, use the following syntax:-
After cPanel & WHM reconstructs the configuration file of Apache, the system scrutinizes the /var/cpanel/conf/splitlogs.conf file. The system then uses the subjects of this file to set command line arguments for CustomLog directives in Apache’s /usr/local/apache/conf/httpd.conf file. This configuration file covers line-delimited key=value pairs. The key entries are the same as the command line arguments.
You have come to know what is splitlogs Binary and how does it work to use this feature in cPanel. Now it’s easy to keep the count of logs in your account and manage them.