Sending PHP errors to the PHP Error Log on server |
[eluser]Sooty[/eluser]
I'm quite new to Codeigniter (still working on my first site) but not new to PHP. I have spent a little while working out the error log having moved my site to the production environment (the one that logs to the application/logs directory within CI itself) and that looks like it's running just fine. However, I'm a creature of habit and have all of my sites logging to the PHP Error log on the server (defined in my php.ini file). Whatever I do, I can't get CI to log errors to this file. In an ideal world I would have all sites logging to this file, and at the same time non of them displaying errors to the user, whilst in production. Any help would be great.
[eluser]Rok Biderman[/eluser]
I've used this in the past with some success. You'd have to make some adjustments, my method to log the errors to the db looked like this in the end. Code: <?php The other option that springs to mind is using log_message, described here
[eluser]Sooty[/eluser]
Thanks Rok. I assumed there would be an easier solution to this, giving that PHP errors are logged as standard (when error logging is enabled in PHP). And the CI Error Handling, as far as I can gather, is for custom errors? I just need to log the default PHP errors. I take it most people here use CI's logging to debug their code in the production environment? |
Welcome Guest, Not a member yet? Register Sign In |