Skip to content

Instantly share code, notes, and snippets.

@evitolins
Created February 4, 2014 23:00
Show Gist options
  • Save evitolins/8814198 to your computer and use it in GitHub Desktop.
Save evitolins/8814198 to your computer and use it in GitHub Desktop.
Simple way to append data to a log file. Can be used for PHP troubleshooting.
<?
$path = '/var/www/myWebsite/myLog.log';
$data = 'myData';
file_put_contents ($path , PHP_EOL . time() .' - ' . $data, FILE_APPEND | LOCK_EX );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment