Ghetto logging for PHP

In the case you need to quickly see if certain code path is executed on a production server for which config cannot be changed.

file_put_contents("/tmp/log.txt", "this is a test entry\n");

The proper method would be

  • Configure error log in php.ini
  • Use error_log()
  • …. or use logging facility of your PHP framework

\"\" Subscribe to RSS feed Follow me on Twitter Follow me on Facebook Follow me Google+

One thought on “Ghetto logging for PHP

Leave a Reply

Your email address will not be published. Required fields are marked *