2

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)

3

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

4
  • if i extend it to even 1000 also error repeats. so why logging a variable giving error? – prasad maganti Dec 30 '14 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. – James Cowie Dec 30 '14 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. – Andrew Kett Jan 1 '15 at 3:23
  • also are you sure the new config is being loaded? – Andrew Kett Jan 1 '15 at 3:25
1

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

xdebug.max_nesting_level=200

It worked !

Here is a more explanation:

xdebug.max_nesting_level
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, privacy policy and cookie policy

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