BaseHandler
in package
implements
HandlerInterface
Base class for logging
Interfaces, Classes and Traits
- HandlerInterface
- Expected behavior for a Log handler
Table of Contents
- $dateFormat : string
- Date format for logging
- $handles : array<string|int, mixed>
- Handles
- __construct() : mixed
- Constructor
- canHandle() : bool
- Checks whether the Handler will handle logging items of this log Level.
- handle() : bool
- Handles logging the message.
- setDateFormat() : HandlerInterface
- Stores the date format to use while logging messages.
Properties
$dateFormat
Date format for logging
protected
string
$dateFormat
= 'Y-m-d H:i:s'
$handles
Handles
protected
array<string|int, mixed>
$handles
Methods
__construct()
Constructor
public
__construct(array<string|int, mixed> $config) : mixed
Parameters
- $config : array<string|int, mixed>
Return values
mixed —canHandle()
Checks whether the Handler will handle logging items of this log Level.
public
canHandle(string $level) : bool
Parameters
- $level : string
Return values
bool —handle()
Handles logging the message.
public
abstract handle(string $level, string $message) : bool
If the handler returns false, then execution of handlers will stop. Any handlers that have not run, yet, will not be run.
Parameters
- $level : string
- $message : string
Return values
bool —setDateFormat()
Stores the date format to use while logging messages.
public
setDateFormat(string $format) : HandlerInterface
Parameters
- $format : string