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)
Sun, Dec 15, 20:23
Unknown Object (File)
Sun, Dec 15, 19:57
Unknown Object (File)
Thu, Dec 12, 17:35
Unknown Object (File)
Tue, Dec 10, 23:40
Unknown Object (File)
Tue, Dec 10, 04:09
Unknown Object (File)
Mon, Dec 9, 04:28
Unknown Object (File)
Thu, Dec 5, 13:17
Unknown Object (File)
Fri, Nov 29, 05:02
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.