Class TDbLogRoute
TDbLogRoute class
TDbLogRoute stores log messages in a database table. To specify the database
table, set setConnectionID ConnectionID to be the ID of a TDataSourceConfig
module and setLogTableName LogTableName. If they are
not setting, an SQLite3 database named 'sqlite3.log' will be created and used
under the runtime directory.
By default, the database table name is 'pradolog'. It has the following structure:
CREATE TABLE pradolog ( log_id INTEGER NOT NULL PRIMARY KEY, level INTEGER, category VARCHAR(128), logtime VARCHAR(20), message VARCHAR(255) );
- TComponent
-
TApplicationComponent
-
TLogRoute
-
TDbLogRoute
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 3.1.2
Located at Util/TLogRouter.php
public
|
|
public
|
#
init(
Initializes this module. This method is required by the IModule interface. It initializes the database for logging purpose. |
protected
|
|
protected
|
|
protected
|
|
public
|
|
public
string
|
|
public
|
#
setConnectionID( string $value )
Sets the ID of a TDataSourceConfig module. The datasource module will be used to establish the DB connection for this log route. |
public
string
|
|
public
|
#
setLogTableName( string $value )
Sets the name of the DB table to store log content. Note, if setAutoCreateLogTable AutoCreateLogTable is false and you want to create the DB table manually by yourself, you need to make sure the DB table is of the following structure: (key CHAR(128) PRIMARY KEY, value BLOB, expire INT) |
public
boolean
|
|
public
|
collectLogs(),
formatLogMessage(),
getCategories(),
getLevelName(),
getLevelValue(),
getLevels(),
setCategories(),
setLevels()
|
getApplication(),
getRequest(),
getResponse(),
getService(),
getSession(),
getUser(),
publishAsset(),
publishFilePath()
|
GLOBAL_RAISE_EVENT_LISTENER
|
$_levelNames,
$_levelValues
|