How to log error 500 situations in 1.1.16 ?

After upgrading at 1.1.16, when (in development) I got an error 500 (for example for an array to string conversion), I see the webpage for error 500 handling, but I cannot see in no one log file the details about where to find it.

Have I touched something, misconfigurin it, or is it related to 1.1.16 upgrading?

how to resolve?

Thanks in advance for your attention

Hi,

I have the same problem. Some errors are showed like production mode, but i still see the details in the file “application.log” :blink:

In my cases I’ve no log, and I’ve debug on, trace level on 3 and enabled log for warning and errors.

One of the things I always check is if the log files are writable by the web server. Maybe that might be the problem?

Thanks for the reply. In my case, the log file has the error detailed. Anybody else can help us? :(

If your log file is logging things fine, then what is the problem you are having?

In the view, some errors are showed like "production enviroment", without stack trace. It is happening after i upgrade from 1.1.14 to 1.1.16.

Can you take a screenshot? Are you saying these error should not appear in the page and/or they do not appear in your log file?

Hi,

Thanks. I attached the screenshot. Below, my index.php file:


<?php


// change the following paths if necessary

$yii=dirname(__FILE__).'/../yii-1.1.16/framework/yii.php';

$config=dirname(__FILE__).'/protected/config/main.php';


// remove the following lines when in production mode

defined('YII_DEBUG') or define('YII_DEBUG',true);

// specify how many levels of call stack should be shown in each log message

defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);


require_once($yii);

Yii::createWebApplication($config)->run();

It’s bug: https://github.com/yiisoft/yii/pull/2903

You can fix it yourself by editing CErrorHandler.php as in my comment.

Thanks rob006,

It worked for me. I think the yii developer team needs to publish that adjustment.

I will not edit a framework file.

I’ll try this




errorHandler => array(

    'errorAction' => YII_DEBUG ? null : array('site/error')

)



as klimov-paul commented on 24 Sep 2013

After this all CHttpExceptions will be handled by errorHandler - you will not be able to test your error pages.

Wow, this IS a problem, thanks for warning me !