shivammathur/homebrew-php

Problem with custom php-fpm.log

HapiCZ opened this issue · 1 comments

Describe the bug
If I set a custom log name in the php-fpm.conf file, two logs are created after FPM restarts. For example, if I name the file as php8.1-fpm.log, after restarting the service, the original php-fpm.log and php8.1-fpm.log will be created at the same time. The problem lies in the configuration files *.plist and *.service, where php-fpm.log is set. So I have to update these files as well. However, there is a risk that they will be overwritten again during the upgrade.

PHP versions
All

To Reproduce

  1. Stop PHP service.
  2. Delete old logs in var/log directory.
  3. Rename php-fpm.log in php-fpm.conf.
  4. Start PHP service5.
  5. There are now two log files in the log directory.

Expected behavior
There should only be one log in the log directory

Additional context
If I have several versions of PHP installed, they all share the same logo. Which can be a problem for logrotate. It would be better if each PHP instance had its own log. But now it's not easy to set up.

Two solutions are possible:

  1. Set a custom name for each php version in Formulas. Eg: php8.1-php.log
  2. Remove the log setting in *.plist and *.service and leave it to the user.

Are you willing to submit a PR?
Maybe. I have no experience with it.

@HapiCZ I would like the formula to work the same way as the php formulae in the core tap, so please create an issue on the core tap. If it is changed there, I will sync it here.