\MonologLogger

Monolog log channel

It contains a stack of Handlers and a stack of Processors, and uses them to store records that are added to it.

Summary

Methods
Properties
Constants
__construct()
getName()
pushHandler()
popHandler()
pushProcessor()
popProcessor()
addRecord()
addDebug()
addInfo()
addWarning()
addError()
addCritical()
addAlert()
getLevelName()
debug()
info()
notice()
warn()
err()
crit()
alert()
emerg()
No public properties found
DEBUG
INFO
WARNING
ERROR
CRITICAL
ALERT
No protected methods found
$levels
$name
$handlers
$processors
N/A
No private methods found
No private properties found
N/A

Constants

DEBUG

DEBUG = 100

Detailed debug information

INFO

INFO = 200

Interesting events

Examples: User logs in, SQL logs.

WARNING

WARNING = 300

Exceptional occurences that are not errors

Examples: Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong.

ERROR

ERROR = 400

Runtime errors

CRITICAL

CRITICAL = 500

Critical conditions

Example: Application component unavailable, unexpected exception.

ALERT

ALERT = 550

Action must be taken immediately

Example: Entire website down, database unavailable, etc. This should trigger the SMS alerts and wake you up.

Properties

$levels

$levels : 

Type

$name

$name : 

Type

$handlers

$handlers : array

The handler stack

Type

array — of Monolog\Handler\HandlerInterface

$processors

$processors : 

Type

Methods

__construct()

__construct(string  $name) 

Parameters

string $name

The logging channel

getName()

getName() : string

Returns

string

pushProcessor()

pushProcessor(callable  $callback) 

Adds a processor in the stack.

Parameters

callable $callback

popProcessor()

popProcessor() : callable

Removes the processor on top of the stack and returns it.

Returns

callable

addRecord()

addRecord(integer  $level, string  $message, array  $context = array()) : Boolean

Adds a log record.

Parameters

integer $level

The logging level

string $message

The log message

array $context

The log context

Returns

Boolean —

Whether the record has been processed

addDebug()

addDebug(string  $message, array  $context = array()) : Boolean

Adds a log record at the DEBUG level.

Parameters

string $message

The log message

array $context

The log context

Returns

Boolean —

Whether the record has been processed

addInfo()

addInfo(string  $message, array  $context = array()) : Boolean

Adds a log record at the INFO level.

Parameters

string $message

The log message

array $context

The log context

Returns

Boolean —

Whether the record has been processed

addWarning()

addWarning(string  $message, array  $context = array()) : Boolean

Adds a log record at the WARNING level.

Parameters

string $message

The log message

array $context

The log context

Returns

Boolean —

Whether the record has been processed

addError()

addError(string  $message, array  $context = array()) : Boolean

Adds a log record at the ERROR level.

Parameters

string $message

The log message

array $context

The log context

Returns

Boolean —

Whether the record has been processed

addCritical()

addCritical(string  $message, array  $context = array()) : Boolean

Adds a log record at the CRITICAL level.

Parameters

string $message

The log message

array $context

The log context

Returns

Boolean —

Whether the record has been processed

addAlert()

addAlert(string  $message, array  $context = array()) : Boolean

Adds a log record at the ALERT level.

Parameters

string $message

The log message

array $context

The log context

Returns

Boolean —

Whether the record has been processed

getLevelName()

getLevelName(integer  $level) : string

Gets the name of the logging level.

Parameters

integer $level

Returns

string

debug()

debug(string  $message, array  $context = array()) : Boolean

Adds a log record at the DEBUG level.

This method allows to have an easy ZF compatibility.

Parameters

string $message

The log message

array $context

The log context

Returns

Boolean —

Whether the record has been processed

info()

info(string  $message, array  $context = array()) : Boolean

Adds a log record at the INFO level.

This method allows to have an easy ZF compatibility.

Parameters

string $message

The log message

array $context

The log context

Returns

Boolean —

Whether the record has been processed

notice()

notice(string  $message, array  $context = array()) : Boolean

Adds a log record at the INFO level.

This method allows to have an easy ZF compatibility.

Parameters

string $message

The log message

array $context

The log context

Returns

Boolean —

Whether the record has been processed

warn()

warn(string  $message, array  $context = array()) : Boolean

Adds a log record at the WARNING level.

This method allows to have an easy ZF compatibility.

Parameters

string $message

The log message

array $context

The log context

Returns

Boolean —

Whether the record has been processed

err()

err(string  $message, array  $context = array()) : Boolean

Adds a log record at the ERROR level.

This method allows to have an easy ZF compatibility.

Parameters

string $message

The log message

array $context

The log context

Returns

Boolean —

Whether the record has been processed

crit()

crit(string  $message, array  $context = array()) : Boolean

Adds a log record at the CRITICAL level.

This method allows to have an easy ZF compatibility.

Parameters

string $message

The log message

array $context

The log context

Returns

Boolean —

Whether the record has been processed

alert()

alert(string  $message, array  $context = array()) : Boolean

Adds a log record at the ALERT level.

This method allows to have an easy ZF compatibility.

Parameters

string $message

The log message

array $context

The log context

Returns

Boolean —

Whether the record has been processed

emerg()

emerg(string  $message, array  $context = array()) : Boolean

Adds a log record at the ALERT level.

This method allows to have an easy ZF compatibility.

Parameters

string $message

The log message

array $context

The log context

Returns

Boolean —

Whether the record has been processed