Appends log events to a db table using PDO.
Configurable parameters of this appender are:
An example:
Located in /appenders/LoggerAppenderPDO.php (line 47)
LoggerConfigurable | --LoggerAppender | --LoggerAppenderPDO
Set in activateOptions() and later used in append() to check if all conditions to append are true.
Create the log table if it does not exists (optional).
The PDO instance.
DSN string for enabling a connection.
A comma separated list of LoggerPatternLayout format strings that replace the "?" in $sql.
Can be set to a complete insert statement with ? that are replaced using insertPattern.
Database password
Prepared statement for the INSERT INTO query.
This appender does not require a layout.
A LoggerPatternLayout string used to format a valid insert query.
Table name to write events. Used only for CREATE TABLE if $createTable is true.
Database user name.
Inherited from LoggerAppender
LoggerAppender::$closed
LoggerAppender::$filter
LoggerAppender::$layout
LoggerAppender::$name
LoggerAppender::$threshold
Setup db connection.
Based on defined options, this method connects to db defined in $dsn and creates a $table table if $createTable is true.
Appends a new event to the database.
Closes the connection to the logging database
Sometimes databases allow only one connection to themselves in one thread.
SQLite has this behaviour. In that case this handle is needed if the database must be checked for events.
Indicator if the logging table should be created on startup, if its not existing.
Sets the DSN string for this connection. In case of
SQLite it could look like this: 'sqlite:appenders/pdotest.sqlite'
Sets the LoggerLayoutPattern format strings for $insertSql.
It's not necessary to change this except you have customized logging.
Sets the SQL INSERT string to use with $insertPattern.
Sets the password for this connection.
Defaults to ''
Sets the SQL string into which the event should be transformed.
Defaults to:
INSERT INTO $this->table ( timestamp, logger, level, message, thread, file, line) VALUES ('%d','%c','%p','%m','%t','%F','%L')
It's not necessary to change this except you have customized logging'
Sets the tablename to which this appender should log.
Defaults to log4php_log
Sets the username for this connection.
Defaults to ''
Inherited From LoggerAppender
LoggerAppender::__construct()
LoggerAppender::activateOptions()
LoggerAppender::addFilter()
LoggerAppender::append()
LoggerAppender::clearFilters()
LoggerAppender::close()
LoggerAppender::doAppend()
LoggerAppender::getDefaultLayout()
LoggerAppender::getFilter()
LoggerAppender::getFirstFilter()
LoggerAppender::getLayout()
LoggerAppender::getName()
LoggerAppender::getThreshold()
LoggerAppender::isAsSevereAsThreshold()
LoggerAppender::requiresLayout()
LoggerAppender::setLayout()
LoggerAppender::setName()
LoggerAppender::setThreshold()
LoggerAppender::warn()
Inherited From LoggerConfigurable
LoggerConfigurable::setBoolean()
LoggerConfigurable::setFileSize()
LoggerConfigurable::setInteger()
LoggerConfigurable::setLevel()
LoggerConfigurable::setNumeric()
LoggerConfigurable::setPositiveInteger()
LoggerConfigurable::setString()
LoggerConfigurable::warn()
Documentation generated on Sat, 18 Feb 2012 22:32:22 +0000 by phpDocumentor 1.4.3