register_shutdown_function('shutdownFunction');
/**
* own shutdown function
* 2010-10-17 ms
*/
function shutDownFunction() {
$error = error_get_last();
if ($error['type'] == 1 && class_exists('CakeLog')) {
CakeLog::write('error', 'Fatal Error in '.$error['file']. ' (line '.
$error['line'].'):' . $error['message']);
}
}
On 4 Feb., 06:23, Amit Badkas <amit.sanis...@gmail.com> wrote:
> Hi,
>
> You can log all the errors including fatal ones by using 'error_log' setting
> in php.ini, for example, my php.ini has
>
> log_errors = On
> error_log = /home/amit/Web/demos/php/logs/php_errors.log
>
> Then if there is any fatal error, I get an entry in php_errors.log like
>
> [04-Feb-2011 10:48:57] PHP Fatal error: Call to a member function test() on
> a non-object in /home/amit/Web/demos/php/fatalError.php on line 3
> [04-Feb-2011 10:48:57] PHP Stack trace:
> [04-Feb-2011 10:48:57] PHP 1. {main}()
> /home/amit/Web/demos/php/fatalError.php:0
>
> Do ensure that your webserver has the permission to write to php_errors.log
>
> Hope that helps.
>
> Amit Badkas
>
> PHP Applications for E-Biz:http://www.sanisoft.com
>
> On Fri, Feb 4, 2011 at 10:39 AM, Dr. Tarique Sani <tariques...@gmail.com>wrote:
>
>
>
>
>
>
>
> > On Fri, Feb 4, 2011 at 10:19 AM, Ryan Schmidt
> > <google-2...@ryandesign.com> wrote:
>
> > > On Feb 3, 2011, at 22:01, Dr. Loboto wrote:
>
> > >> Cake's logging settings can work only when Cake is working. If PHP
> > >> dies on parse error it just don't reach Cake setup code at all. Same
> > >> about fatal error before Cake sets own log. Etc. You better read PHP
> > >> docs before blame Cake ones.
>
> > > So are you saying there are some CakePHP-related fatal errors that
> > CakePHP would log, and other PHP-related fatal errors (parse errors, etc.)
> > that it wouldn't?
>
> > I went and saw that page, the information on the page is wrongly
> > represented E_WARNING is the level of error reporting which shows only
> > warnings and fatal errors, however if you set Configure::write('log',
> > E_WARNING); only warnings will be logged because fatal error will kill
> > PHP before it reaches CakePHP's Configure::write() method
>
> > Cheers
> > Tarique
>
> > --
> > =============================================================
> > PHP for E-Biz:http://sanisoft.com
> > =============================================================
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.c om>For more options, visit this group at
> >http://groups.google.com/group/cake-php
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
No comments:
Post a Comment