2

I'm trying to make php-fpm not log requests that it does in the current format when running through docker-compose. (php 7.4-alpine fpm):

php       | 192.168.96.4 -  04/Jun/2020:15:24:27 +0000 "GET /index.php" 302
php       | 192.168.96.4 -  04/Jun/2020:15:24:28 +0000 "GET /index.php" 302
php       | 192.168.96.4 -  04/Jun/2020:15:24:29 +0000 "GET /index.php" 200

I want to do this so that my docker-compose file only logs logs generated by my PHP application to stdout.

How do i disable this logging, so that FPM doesnt log these lines anymore?

What i have Tried

I have tried to change the FPM log level and format but neither seem to have effect?

    command: ["php-fpm", '-d', 'log_level=warning', '-d', 'access.format= ""']

but this didnt provide any result. I Tried googling for this but came up empty handed (only old php5 search results)

Joel Harkes
  • 10,975
  • 3
  • 46
  • 65

1 Answers1

1

This can be achieved pretty easily by adding the following line to your PHP-FPM pool configuration file (usually found as /usr/local/etc/php-fpm.d/www.conf in Alpine)

[www]
access.log = /dev/null