\MonologErrorHandler

Monolog error handler

A facility to enable logging of runtime errors, exceptions and fatal errors.

Quick setup: ErrorHandler::register($logger);

Summary

Methods
Properties
Constants
__construct()
register()
registerExceptionHandler()
registerErrorHandler()
registerFatalHandler()
handleException()
handleError()
handleFatalError()
No public properties found
No constants found
defaultErrorLevelMap()
No protected properties found
N/A
codeToString()
$logger
$previousExceptionHandler
$uncaughtExceptionLevel
$previousErrorHandler
$errorLevelMap
$handleOnlyReportedErrors
$hasFatalErrorHandler
$fatalLevel
$reservedMemory
$fatalErrors
N/A

Properties

$logger

$logger : 

Type

$previousExceptionHandler

$previousExceptionHandler : 

Type

$uncaughtExceptionLevel

$uncaughtExceptionLevel : 

Type

$previousErrorHandler

$previousErrorHandler : 

Type

$errorLevelMap

$errorLevelMap : 

Type

$handleOnlyReportedErrors

$handleOnlyReportedErrors : 

Type

$hasFatalErrorHandler

$hasFatalErrorHandler : 

Type

$fatalLevel

$fatalLevel : 

Type

$reservedMemory

$reservedMemory : 

Type

$fatalErrors

$fatalErrors : 

Type

Methods

register()

register(\Psr\Log\LoggerInterface  $logger, array|false  $errorLevelMap = array(), integer|false  $exceptionLevel = null, integer|false  $fatalLevel = null) : \Monolog\ErrorHandler

Registers a new ErrorHandler for a given Logger

By default it will handle errors, exceptions and fatal errors

Parameters

\Psr\Log\LoggerInterface $logger
array|false $errorLevelMap

an array of E_ constant to LogLevel:: constant mapping, or false to disable error handling

integer|false $exceptionLevel

a LogLevel::* constant, or false to disable exception handling

integer|false $fatalLevel

a LogLevel::* constant, or false to disable fatal error handling

Returns

\Monolog\ErrorHandler

registerExceptionHandler()

registerExceptionHandler(  $level = null,   $callPrevious = true) 

Parameters

$level
$callPrevious

registerErrorHandler()

registerErrorHandler(array  $levelMap = array(),   $callPrevious = true,   $errorTypes = -1,   $handleOnlyReportedErrors = true) 

Parameters

array $levelMap
$callPrevious
$errorTypes
$handleOnlyReportedErrors

registerFatalHandler()

registerFatalHandler(  $level = null,   $reservedMemorySize = 20) 

Parameters

$level
$reservedMemorySize

handleException()

handleException(  $e) 

Parameters

$e

handleError()

handleError(  $code,   $message,   $file = '',   $line,   $context = array()) 

Parameters

$code
$message
$file
$line
$context

handleFatalError()

handleFatalError() 

defaultErrorLevelMap()

defaultErrorLevelMap() 

codeToString()

codeToString(  $code) 

Parameters

$code