PHP 클래스 Prado\Util\TDbLogRoute

TDbLogRoute stores log messages in a database table. To specify the database table, set {@link setConnectionID ConnectionID} to be the ID of a {@link TDataSourceConfig} module and {@link 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) );
부터: 3.1.2
저자: Qiang Xue ([email protected])
상속: extends TLogRoute
파일 보기 프로젝트 열기: pradosoft/prado

공개 메소드들

메소드 설명
__destruct ( ) Destructor.
getAutoCreateLogTable ( ) : boolean
getConnectionID ( ) : string
getDbConnection ( ) : TDbConnection
getLogTableName ( ) : string
init ( $config ) Initializes this module.
setAutoCreateLogTable ( $value )
setConnectionID ( $value ) Sets the ID of a TDataSourceConfig module.
setLogTableName ( $value ) Sets the name of the DB table to store log content.

보호된 메소드들

메소드 설명
createDbConnection ( ) : TDbConnection Creates the DB connection.
createDbTable ( ) Creates the DB table for storing log messages.
processLogs ( $logs ) Stores log messages into database.

메소드 상세

__destruct() 공개 메소드

Disconnect the db connection.
public __destruct ( )

createDbConnection() 보호된 메소드

Creates the DB connection.
protected createDbConnection ( ) : TDbConnection
리턴 Prado\Data\TDbConnection the created DB connection

createDbTable() 보호된 메소드

Creates the DB table for storing log messages.
protected createDbTable ( )

getAutoCreateLogTable() 공개 메소드

또한 보기: setAutoCreateLogTable
public getAutoCreateLogTable ( ) : boolean
리턴 boolean whether the log DB table should be automatically created if not exists. Defaults to true.

getConnectionID() 공개 메소드

public getConnectionID ( ) : string
리턴 string the ID of a {@link TDataSourceConfig} module. Defaults to empty string, meaning not set.

getDbConnection() 공개 메소드

public getDbConnection ( ) : TDbConnection
리턴 Prado\Data\TDbConnection the DB connection instance

getLogTableName() 공개 메소드

또한 보기: setAutoCreateLogTable
public getLogTableName ( ) : string
리턴 string the name of the DB table to store log content. Defaults to 'pradolog'.

init() 공개 메소드

This method is required by the IModule interface. It initializes the database for logging purpose.
public init ( $config )

processLogs() 보호된 메소드

Stores log messages into database.
protected processLogs ( $logs )

setAutoCreateLogTable() 공개 메소드

또한 보기: setLogTableName
public setAutoCreateLogTable ( $value )

setConnectionID() 공개 메소드

The datasource module will be used to establish the DB connection for this log route.
public setConnectionID ( $value )

setLogTableName() 공개 메소드

Note, if {@link 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)
또한 보기: setAutoCreateLogTable
public setLogTableName ( $value )