PHP Class Monolog\Logger

It contains a stack of Handlers and a stack of Processors, and uses them to store records that are added to it.
Author: Jordi Boggiano ([email protected])
Datei anzeigen Open project: pmjones/php-framework-benchmarks Class Usage Examples

Protected Properties

Property Type Description
$handlers The handler stack
$levels
$name
$processors

Public Methods

Method Description
__construct ( string $name )
addAlert ( string $message, array $context = [] ) : boolean Adds a log record at the ALERT level.
addCritical ( string $message, array $context = [] ) : boolean Adds a log record at the CRITICAL level.
addDebug ( string $message, array $context = [] ) : boolean Adds a log record at the DEBUG level.
addError ( string $message, array $context = [] ) : boolean Adds a log record at the ERROR level.
addInfo ( string $message, array $context = [] ) : boolean Adds a log record at the INFO level.
addRecord ( integer $level, string $message, array $context = [] ) : boolean Adds a log record.
addWarning ( string $message, array $context = [] ) : boolean Adds a log record at the WARNING level.
alert ( string $message, array $context = [] ) : boolean Adds a log record at the ALERT level.
crit ( string $message, array $context = [] ) : boolean Adds a log record at the CRITICAL level.
debug ( string $message, array $context = [] ) : boolean Adds a log record at the DEBUG level.
emerg ( string $message, array $context = [] ) : boolean Adds a log record at the ALERT level.
err ( string $message, array $context = [] ) : boolean Adds a log record at the ERROR level.
getLevelName ( integer $level ) : string Gets the name of the logging level.
info ( string $message, array $context = [] ) : boolean Adds a log record at the INFO level.
notice ( string $message, array $context = [] ) : boolean Adds a log record at the INFO level.
popHandler ( ) : Monolog\Handler\HandlerInterface Pops an handler from the stack
popProcessor ( ) : callable Removes the processor on top of the stack and returns it.
pushHandler ( Monolog\Handler\HandlerInterface $handler ) Pushes an handler on the stack.
pushProcessor ( callable $callback ) Adds a processor in the stack.
warn ( string $message, array $context = [] ) : boolean Adds a log record at the WARNING level.

Method Details

__construct() public method

public __construct ( string $name )
$name string The logging channel

addAlert() public method

Adds a log record at the ALERT level.
public addAlert ( string $message, array $context = [] ) : boolean
$message string The log message
$context array The log context
return boolean Whether the record has been processed

addCritical() public method

Adds a log record at the CRITICAL level.
public addCritical ( string $message, array $context = [] ) : boolean
$message string The log message
$context array The log context
return boolean Whether the record has been processed

addDebug() public method

Adds a log record at the DEBUG level.
public addDebug ( string $message, array $context = [] ) : boolean
$message string The log message
$context array The log context
return boolean Whether the record has been processed

addError() public method

Adds a log record at the ERROR level.
public addError ( string $message, array $context = [] ) : boolean
$message string The log message
$context array The log context
return boolean Whether the record has been processed

addInfo() public method

Adds a log record at the INFO level.
public addInfo ( string $message, array $context = [] ) : boolean
$message string The log message
$context array The log context
return boolean Whether the record has been processed

addRecord() public method

Adds a log record.
public addRecord ( integer $level, string $message, array $context = [] ) : boolean
$level integer The logging level
$message string The log message
$context array The log context
return boolean Whether the record has been processed

addWarning() public method

Adds a log record at the WARNING level.
public addWarning ( string $message, array $context = [] ) : boolean
$message string The log message
$context array The log context
return boolean Whether the record has been processed

alert() public method

This method allows to have an easy ZF compatibility.
public alert ( string $message, array $context = [] ) : boolean
$message string The log message
$context array The log context
return boolean Whether the record has been processed

crit() public method

This method allows to have an easy ZF compatibility.
public crit ( string $message, array $context = [] ) : boolean
$message string The log message
$context array The log context
return boolean Whether the record has been processed

debug() public method

This method allows to have an easy ZF compatibility.
public debug ( string $message, array $context = [] ) : boolean
$message string The log message
$context array The log context
return boolean Whether the record has been processed

emerg() public method

This method allows to have an easy ZF compatibility.
public emerg ( string $message, array $context = [] ) : boolean
$message string The log message
$context array The log context
return boolean Whether the record has been processed

err() public method

This method allows to have an easy ZF compatibility.
public err ( string $message, array $context = [] ) : boolean
$message string The log message
$context array The log context
return boolean Whether the record has been processed

getLevelName() public static method

Gets the name of the logging level.
public static getLevelName ( integer $level ) : string
$level integer
return string

info() public method

This method allows to have an easy ZF compatibility.
public info ( string $message, array $context = [] ) : boolean
$message string The log message
$context array The log context
return boolean Whether the record has been processed

notice() public method

This method allows to have an easy ZF compatibility.
public notice ( string $message, array $context = [] ) : boolean
$message string The log message
$context array The log context
return boolean Whether the record has been processed

popHandler() public method

Pops an handler from the stack
public popHandler ( ) : Monolog\Handler\HandlerInterface
return Monolog\Handler\HandlerInterface

popProcessor() public method

Removes the processor on top of the stack and returns it.
public popProcessor ( ) : callable
return callable

pushHandler() public method

Pushes an handler on the stack.
public pushHandler ( Monolog\Handler\HandlerInterface $handler )
$handler Monolog\Handler\HandlerInterface

pushProcessor() public method

Adds a processor in the stack.
public pushProcessor ( callable $callback )
$callback callable

warn() public method

This method allows to have an easy ZF compatibility.
public warn ( string $message, array $context = [] ) : boolean
$message string The log message
$context array The log context
return boolean Whether the record has been processed

Property Details

$handlers protected_oe property

The handler stack
protected $handlers

$levels protected_oe static_oe property

protected static $levels

$name protected_oe property

protected $name

$processors protected_oe property

protected $processors