EventLogDatabaseTiein: ezcLogDatabaseWriter
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcLogDatabaseWriter
|
The ezcLogDatabaseWriter provides an implementation to write log messages to the database. [
source]
Implemented Interfaces
table message datetime severity source category
Method Summary
|
public ezcLogDatabaseWriter |
__construct(
$databaseInstance, [$defaultTable = false] )
Construct a new database log-writer. |
|
public array(string=>string) |
getColumnTranslations(
)
Returns an array that describes the coupling between the logMessage information and the columns in the database. |
|
public void |
setTable(
$logFilter, $tableName )
Maps the table $tableName to the messages specified by the ezcLogFilter $logFilter. |
|
public void |
unmap(
$logFilter, $tableName, $fileName )
Unmaps the table $tableName from the messages specified by the ezcLogFilter $logFilter. |
|
public void |
writeLogMessage(
$message, $severity, $source, $category, [$optional = array()], $severity
)
Writes the message $message to the log. |
|
public mixed |
__get(
$name )
Returns the property $name. |
|
public void |
__set(
$name, $value )
Sets the property $name to $value. |
Methods
__construct
ezcLogDatabaseWriter __construct(
$databaseInstance, [string
$defaultTable = false] )
Construct a new database log-writer.
If $databaseInstance is given, that instance will be used for writing. If it is omitted the default database instance will be retrieved.
This constructor is a tie-in.
Parameters
| Name |
Type |
Description |
$defaultTable |
string |
|
$databaseInstance |
ezcDbHandler |
|
getColumnTranslations
array(string=>string) getColumnTranslations(
)
Returns an array that describes the coupling between the logMessage information and the columns in the database.
setTable
void setTable(
$logFilter, string
$tableName )
Maps the table $tableName to the messages specified by the
ezcLogFilter $logFilter.
Log messages that matches with the filter are written to the table $tableName. This method works the same as ezclog::map().
Parameters
| Name |
Type |
Description |
$logFilter |
ezcLogFilter |
|
$tableName |
string |
|
unmap
void unmap(
$logFilter,
$tableName, string
$fileName )
Unmaps the table $tableName from the messages specified by the
ezcLogFilter $logFilter.
Log messages that matches with the filter are no longer written to the table $tableName. This method works the same as ezclog::unmap().
Parameters
| Name |
Type |
Description |
$logFilter |
ezcLogFilter |
|
$fileName |
string |
|
$tableName |
|
|
writeLogMessage
void writeLogMessage(
string
$message,
$severity,
$source, string
$category, [array(string=>string)
$optional = array()], int
$severity
)
Writes the message $message to the log.
The writer can use the severity, source, and category to filter the incoming messages and determine the location where the messages should be written.
$optional may contain extra information that can be added to the log. For example: line numbers, file names, usernames, etc.
Parameters
| Name |
Type |
Description |
$message |
string |
|
$severity
|
int |
ezcLog:: DEBUG, SUCCES_AUDIT, FAILED_AUDIT, INFO, NOTICE, WARNING, ERROR or FATAL. $param string $source |
$category |
string |
|
$optional |
array(string=>string) |
|
$severity |
|
|
$source |
|
|
Throws
| Class | Description |
ezcLogWriterException |
when the log writer was unable to write the log message. |
__get
mixed __get(
string
$name )
Returns the property $name.
Parameters
| Name |
Type |
Description |
$name |
string |
|
Throws
| Class | Description |
ezcBasePropertyNotFoundException |
if the property does not exist. |
__set
void __set(
string
$name, mixed
$value )
Sets the property $name to $value.
Parameters
| Name |
Type |
Description |
$name |
string |
|
$value |
mixed |
|
Throws
| Class | Description |
ezcBasePropertyNotFoundException |
if the property does not exist. |
Last updated: Fri, 02 Nov 2007