Yii Framework Forum: How Do I Get The Profiling Information Logged Rather Than Shown On The Page? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How Do I Get The Profiling Information Logged Rather Than Shown On The Page? Rate Topic: -----

#1 User is offline   matteosistisette 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 77
  • Joined: 08-June 12

Posted 23 March 2013 - 06:30 PM

I have tried profiling, but to my astonishment, the profile information is shown in the web page itself, even though I have no CWebLogRoute enabled.

As far as I can understand from the documentation, in order to use profiling (be it generic performance profiling or SQL query performance profiling by enabling db->enableProfiling), I need to put a CProfileLogRoute in the logger. However, I can't seem to find a way to have this information logged through the CFileLogger I already use rather than shown in the web page itself.

I must be missing something. It can't be true that the only available option for profiling is to have it shown on the web page (so you can't do profiling on a page that is up an running).

How do I accomplish that?
0

#2 User is offline   mrk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 33
  • Joined: 07-March 11

Posted 24 March 2013 - 10:27 AM

You just have to specify it properly in your config file:
        'log' => array(
            'class' => 'CLogRouter',
            'routes' => array(
                array(
                    'class' => 'CFileLogRoute',
                    'levels' => 'profile',
                    'enabled' => true
                ),
            ),
        ),


Can you show section 'log' from your config file? Perhaps I'll be able to tell you why profiling information are still shown on webpage when you haven't it enabled.
1

#3 User is offline   matteosistisette 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 77
  • Joined: 08-June 12

Posted 24 March 2013 - 11:06 AM

View Postmrk, on 24 March 2013 - 10:27 AM, said:

You just have to specify it properly in your config file:
        'log' => array(
            'class' => 'CLogRouter',
            'routes' => array(
                array(
                    'class' => 'CFileLogRoute',
                    'levels' => 'profile',
                    'enabled' => true
                ),
            ),
        ),


Can you show section 'log' from your config file? Perhaps I'll be able to tell you why profiling information are still shown on webpage when you haven't it enabled.


Oh, I see, thanks!

That should be better documented.

I was using CProfileLogRoute instead, as it is the only option mentioned in the Definitive Guide:

http://www.yiiframew...mance-profiling

array(
                    'class'=>'CProfileLogRoute',
                    'report'=>'summary',
                    
                ),


(besides my CFileLogRoute)

The reference of YiiBase::beginProfile() and endProfile() doesn't say a word about how you can route the results, and the reference of CFileLogRouter doesn't specify the valid values for 'levels' (or the standard ones, as I guess one can add his own arbitrary levels maybe).
0

#4 User is offline   mrk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 33
  • Joined: 07-March 11

Posted 24 March 2013 - 11:11 AM

Now just change

array(
                    'class'=>'CProfileLogRoute',
                    'report'=>'summary',
                    
                ),


into

array(
                    'class'=>'CProfileLogRoute',
                    'report'=>'summary',
                    'enabled' => false  
                    
                ),


to get rid of this webpage logging.
0

#5 User is offline   matteosistisette 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 77
  • Joined: 08-June 12

Posted 24 March 2013 - 11:21 AM

View Postmrk, on 24 March 2013 - 11:11 AM, said:

Now just change
into

to get rid of this webpage logging.


Of course! ;)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users