Page MenuHomeDevCentral

Improve PHP logging on dev server
ClosedPublic

Authored by dereckson on Nov 22 2017, 09:35.
Tags
None
Referenced Files
F3768362: D1252.id3224.diff
Sat, Nov 23, 07:39
F3768039: D1252.id.diff
Sat, Nov 23, 05:31
Unknown Object (File)
Wed, Nov 20, 10:09
Unknown Object (File)
Tue, Nov 19, 06:41
Unknown Object (File)
Tue, Nov 19, 06:41
Unknown Object (File)
Tue, Nov 19, 06:40
Unknown Object (File)
Tue, Nov 19, 06:40
Unknown Object (File)
Tue, Nov 19, 06:29
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 Passed
Unit
No Test Coverage
Branch
php-fpm-tweak
Build Status
Buildable 1994
Build 2242: arc lint + arc unit

Event Timeline

Must be rebased against curent php-fpm code.

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

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.