Class CLogger
CLogger records log messages in memory.
CLogger implements the methods to retrieve the messages with various filter conditions, including log levels and log categories.
- CComponent
- CLogger
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/framework/logging/CLogger.php
public
|
#
log( string $message, string $level = 'info', string $category = 'application' )
Logs a message. Messages logged by this method may be retrieved back via
|
public
array
|
|
public
float
|
#
getExecutionTime( )
Returns the total time for serving the current request. This method calculates the difference between now and the timestamp defined by constant YII_BEGIN_TIME. To estimate the execution time more accurately, the constant should be defined as early as possible (best at the beginning of the entry script.) |
public
integer
|
#
getMemoryUsage( )
Returns the memory usage of the current application. This method relies on the PHP function memory_get_usage(). If it is not available, the method will attempt to use OS programs to determine the memory usage. A value 0 will be returned if the memory usage can still not be determined. |
public
array
|
#
getProfilingResults( string $token = null, string $categories = null, boolean $refresh = false )
Returns the profiling results. The results may be filtered by token and/or category. If no filter is specified, the returned results would be an array with each element being array($token,$category,$time). If a filter is specified, the results would be an array of timings. |
public
|
#
flush( boolean $dumpLogs = false )
Removes all recorded messages from the memory. This method will raise an
|
public
|
string |
LEVEL_TRACE
|
'trace' |
|
string |
LEVEL_WARNING
|
'warning' |
|
string |
LEVEL_ERROR
|
'error' |
|
string |
LEVEL_INFO
|
'info' |
|
string |
LEVEL_PROFILE
|
'profile' |
public
integer
|
$autoFlush | 10000 |
#
how many messages should be logged before they are flushed to destinations.
Defaults to 10,000, meaning for every 10,000 messages, the |
public
boolean
|
$autoDump | false |
#
this property will be passed as the parameter to |
public
array
|
$logs |
#
List of messages. Each array element represents one message with the following structure: array( [0] => message (string) [1] => level (string) [2] => category (string) [3] => timestamp (float, obtained by microtime(true));. |
public
float
|
$executionTime |
#
The total time for serving the current request. |
public
integer
|
$memoryUsage |
#
Memory usage of the application (in bytes). |
public
array
|
$profilingResults |
#
The profiling results. |