Page MenuHomeDevCentral

Improve PHP logging on dev server
ClosedPublic

Authored by dereckson on Nov 22 2017, 09:35.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 21, 22:49
Unknown Object (File)
Mon, Oct 21, 05:01
Unknown Object (File)
Sun, Oct 20, 11:13
Unknown Object (File)
Sat, Oct 19, 10:57
Unknown Object (File)
Tue, Oct 15, 09:23
Unknown Object (File)
Sat, Oct 12, 21:50
Unknown Object (File)
Wed, Oct 9, 06:20
Unknown Object (File)
Oct 6 2024, 00:01
Subscribers
None

Details

Summary

In the current php-fpm configuration, two scenarii are possible:

  • by the default PHP configuration, the errors will be printed directly to the web page
  • if the application configures the logging, errors and fatal exceptions are lost if the application itself doesn't catch them.

This change will provide a log in /var/log/www instead.

If, in addition to the log, a display on web is welcome,
you can add to the pillar entry display_errors: on.

Reference: http://php.net/manual/en/install.fpm.configuration.php

Test Plan

Tested on Ysul.

After a php-fpm service reload:
tail -f /var/log/www/nasqueron.org/api-php.log

Log correctly appears.

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Must be rebased against curent php-fpm code.

roles/webserver-legacy/php-sites/php-fpm.sls
52

it's subworld readable for a subworld defined as "every other sites".

dereckson marked an inline comment as done.

Rebased against current master, updated pillar.

dereckson retitled this revision from Improve PHP logging to Improve PHP logging on dev server.
dereckson edited the summary of this revision. (Show Details)
dereckson edited the test plan for this revision. (Show Details)

Let's hide regular output as we've the log.

Don't display errors by default

dereckson edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Feb 17 2018, 12:18
This revision was automatically updated to reflect the committed changes.