How to Enable Logging for the eG PHP Profiler?
To track the status of profiler operations and to troubleshoot issues that you may experience when working with the eG PHP Profiler, you need to enable logging for the profiler. For that, follow the steps below:
- Login to the eG agent / profiler host.
- The PHP Profiler logs are created in the /var/log/eGPhpBTM directory. To enable the profiler to create log files in this directory and write to them, you need to do the following:
Add the web server user to the group that has permissions to write to the /var/log directory. For that, run the following command at the Shell prompt:
usermod -a -G <Name_of_Group> <Webserver_User>
For instance, if the group named 'Syslog' has write permissions to the /var/log directory, and the web server user name is 'apache', your command will be:
usermod -a -G Syslog apache
Next, you need to allow every member of the group (i.e., the group that includes the web server user) to read from and write to files in the /var/log directory. For that, issue the following command at the prompt.
chmod g+rws /var/log/
-
Restart the web server or the PHP-FPM service.
Once this is done, the profiler will automatically create the PHPProfLogs file in the var/log/eGPhpBTM directory and start writing messages to that file. You can look up the PHPProfLogs file if you want to check the status of profiler operations or to troubleshoot issues with the profiler.