0

I am writing a application in Yii Framework .Using the Yii Logger for my application log . I want to write log on entry and exit of each function . Now what i have to do is to go in each function and write the entry and exit log . Is there any way in yii from which this entry and exit log would be automatically logged in log file ?

Thanks ,

Pradeep Jaiswar
  • 1,785
  • 7
  • 27
  • 48
  • What's the purpose of this? Perhaps you need different solution? Like [profiler](http://www.xdebug.org/docs/profiler)? –  Sep 16 '13 at 10:57
  • I need to have entry and exit in my log statement ..n i donr want to go n write entry and exit log in each function !! – Pradeep Jaiswar Sep 16 '13 at 11:16
  • But why do you need this? –  Sep 16 '13 at 11:19
  • to check if my function in behaving properly , once entered exiting properly .. after which function which function is called ... – Pradeep Jaiswar Sep 16 '13 at 11:26
  • I honestly don't see why you need to do this because in my humble opinion (could be stupid too :D ), Yii does give you enough information to be able to detect the function in which an erroneous call resides – Oladapo Omonayajo Sep 16 '13 at 12:47
  • Maybe you need some tests for this and not profiler? Or try some debug tool. – ineersa Sep 16 '13 at 14:31
  • By "function" to you mean "action"? There are probably about at least 100 function calls on each request in Yii. I don't assume you want to log them all? – Michael Härtl Sep 16 '13 at 19:41
  • If you only want to log calls to action methods, then you can do so by extending your base controller. See http://stackoverflow.com/a/18854455/759517 for details. – ernie Sep 17 '13 at 16:00

0 Answers0