Search code examples
phploggingerror-handlingerror-log

What is the PHP error log remote location?


In PHP, I am using this code to define where to log errors:

ini_set('error_log', dirname(__FILE__) . '/err_logs/error_log.txt');

On a normal server it works great, but I am using Heroku and apparently when the virtual machine is terminated and then restarted, I lose the error log text file!

Can I store the error log text file onto a remote location?


Solution

  • Create a cron job that emails you the log every day. Or, you can move it using SSH, FTP, or a web service.