Zend\Log\Writer\Db
Synopsis
class Db
extends AbstractWriter
{
- // members
- protected Adapter $db;
- protected string $tableName;
- protected null|array $columnMap;
- protected string $separator;
- // Inherited members from AbstractWriter
- protected FilterPluginManager $filterPlugins;
- protected FormatterPluginManager $formatterPlugins;
- protected array $filters;
- protected FormatterInterface $formatter;
- protected bool $convertWriteErrorsToExceptions;
- protected bool $errorsToExceptionsConversionLevel;
- // methods
- public void __construct()
- public void shutdown()
- protected void doWrite()
- protected string prepareInsert()
- protected array mapEventIntoColumn()
- protected array eventIntoColumn()
- // Inherited methods from AbstractWriter
- public Logger __construct()
- public AbstractWriter addFilter()
- public FilterPluginManager getFilterPluginManager()
- public self setFilterPluginManager()
- public FilterInterface filterPlugin()
- public FormatterPluginManager getFormatterPluginManager()
- public self setFormatterPluginManager()
- public FormatterInterface formatterPlugin()
- public void write()
- public self setFormatter()
- protected FormatterInterface getFormatter()
- protected bool hasFormatter()
- public void setConvertWriteErrorsToExceptions()
- public void shutdown()
- protected abstract void doWrite()
Hierarchy
Extends
Members
protected
- $columnMap
—
Zend\Log\Writer\null|array
Relates database columns names to log data field keys. - $convertWriteErrorsToExceptions
—
Zend\Log\Writer\bool
Use Zend\Stdlib\ErrorHandler to report errors during calls to write - $db
—
Zend\Db\Adapter\Adapter
Db adapter instance - $errorsToExceptionsConversionLevel
—
Zend\Log\Writer\bool
Error level passed to Zend\Stdlib\ErrorHandler::start for errors reported during calls to write - $filterPlugins
—
Zend\Log\Writer\FilterPluginManager
Filter plugins - $filters
—
array
Filter chain - $formatter
—
Zend\Log\Writer\Formatter\FormatterInterface
Formats the log message before writing - $formatterPlugins
—
Zend\Log\Writer\FormatterPluginManager
Formatter plugins - $separator
—
string
Field separator for sub-elements - $tableName
—
string
Table name
Methods
protected
- doWrite() — Write a message to the log.
- eventIntoColumn() — Transform event into column for the db table
- mapEventIntoColumn() — Map event into column using the $columnMap array
- prepareInsert() — Prepare the INSERT SQL statement
public
- __construct() — Constructor
- shutdown() — Remove reference to database adapter
Inherited from Zend\Log\Writer\AbstractWriter
protected
- doWrite() — Write a message to the log
- getFormatter() — Get formatter
- hasFormatter() — Check if the writer has a formatter
public
- addFilter() — Add a filter specific to this writer.
- filterPlugin() — Get filter instance
- formatterPlugin() — Get formatter instance
- getFilterPluginManager() — Get filter plugin manager
- getFormatterPluginManager() — Get formatter plugin manager
- setConvertWriteErrorsToExceptions() — Set convert write errors to exception flag
- setFilterPluginManager() — Set filter plugin manager
- setFormatter() — Set a new formatter for this writer
- setFormatterPluginManager() — Set formatter plugin manager
- shutdown() — Perform shutdown activities such as closing open resources
- write() — Log a message to this writer.