\Pop\Log\WriterDb

Db log writer class

Summary

Methods
Properties
Constants
setLogLimit()
getLogLimit()
hasLogLimit()
isWithinLogLimit()
writeLog()
getContext()
__construct()
No public properties found
No constants found
createTable()
$limit
$db
$table
N/A
No private methods found
No private properties found
N/A

Properties

$limit

$limit : integer

Log limit

Type

integer

$table

$table : string

Table

Type

string

Methods

setLogLimit()

setLogLimit(integer  $level) : \Pop\Log\Writer\AbstractWriter

Set log limit

Parameters

integer $level

Returns

\Pop\Log\Writer\AbstractWriter

getLogLimit()

getLogLimit() : integer

Get log limit

Returns

integer

hasLogLimit()

hasLogLimit() : boolean

Has log limit

Returns

boolean

isWithinLogLimit()

isWithinLogLimit(integer  $level) : boolean

Check if a log level is within the set log level limit

Parameters

integer $level

Returns

boolean

writeLog()

writeLog(mixed  $level, string  $message, array  $context = array()) : \Pop\Log\Writer\Db

Write to the log

Parameters

mixed $level
string $message
array $context

Returns

\Pop\Log\Writer\Db

getContext()

getContext(array  $context = array()) : string

Get context for log

Parameters

array $context

Returns

string

__construct()

__construct(\Pop\Db\Adapter\AbstractAdapter  $db, string  $table = 'pop_log') 

Constructor

Instantiate the DB writer object

The DB table requires the following fields at a minimum: timestamp DATETIME level INT name VARCHAR message TEXT, VARCHAR, etc. context TEXT, VARCHAR, etc.

Parameters

\Pop\Db\Adapter\AbstractAdapter $db
string $table

createTable()

createTable() : void

Create table in database