In app\Mage.php under dispatchEvent function i have written Mage::log($name) before "return $result" to get events list executed on any action.

In System > Config if i save any field value i'm getting

Fatal error: Maximum function nesting level of '100' reached.

If i comment or remove Mage::log($name) its saving normally.

Could you please help me on why i'm getting this error when i write Mage::log($name)

2 Answers 2


I am not sure why logging that variable causes this but the error is due to xdebug, specifically the max_nesting_level being reached. You can probably get rid of the error by increasing this setting to something higher, say 200. http://xdebug.org/docs/all_settings#max_nesting_level

  • if i extend it to even 1000 also error repeats. so why logging a variable giving error? Dec 30, 2014 at 9:48
  • I remember this being an issue with how xDebug works and in combination to the way some of the internals of Magento are wired you will get this error. I either update the nesting level to 200+ or disable xdebug depending on the severity of the issue. Dec 30, 2014 at 12:37
  • The $name variable should only be a string so I can't really see why it would cause an issue. possibly its just being called a lot. Jan 1, 2015 at 3:23
  • also are you sure the new config is being loaded? Jan 1, 2015 at 3:25

I just set more for xdebug in php.ini file below:


It worked !

Here is a more explanation:

Type: integer, Default value: 256
Controls the protection mechanism for infinite recursion protection. The value >of this setting is the maximum level of nested functions that are allowed >before >the script will be aborted.

Before Xdebug 2.3, the default value was 100.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.