Logger
extends AbstractLogger
in package
PSR-3 compatible Logger called from eacDoojigger logging functions
Tags
Table of Contents
- LOG_ACTION = 'eac_logger_output'
- LOG_READY = 'eac_logger_ready'
- __construct() : mixed
- set filter to trigger despooling at end of 'plugins_loaded'
- _logger_ready() : void
- despool or clear logging queue.
- alert() : void
- Action must be taken immediately.
- critical() : void
- Critical conditions.
- debug() : void
- Detailed debug information.
- emergency() : void
- System is unusable.
- error() : void
- Runtime errors that do not require immediate action but should typically be logged and monitored.
- info() : void
- Interesting events.
- interpolate() : string
- Interpolates context values into the message placeholders.
- log() : void
- Logs with an arbitrary level
- notice() : void
- Normal but significant events.
- subscribe() : void
- outside actors may subscribe and provide the function to actually log the data
- warning() : void
- Exceptional occurrences that are not errors.
Constants
LOG_ACTION
public
string
LOG_ACTION
= 'eac_logger_output'
logging action names
LOG_READY
public
mixed
LOG_READY
= 'eac_logger_ready'
Methods
__construct()
set filter to trigger despooling at end of 'plugins_loaded'
public
__construct() : mixed
Return values
mixed —_logger_ready()
despool or clear logging queue.
public
static _logger_ready() : void
log entries are queued until outside actors have a chance to subscribe. if no subscribers, disable logging, else despool and disable queueing.
Return values
void —alert()
Action must be taken immediately.
public
alert(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Example: Entire website down, database unavailable, etc. This should trigger the SMS alerts and wake you up.
Parameters
- $message : string|Stringable
- $context : array<string|int, mixed> = []
Return values
void —critical()
Critical conditions.
public
critical(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Example: Application component unavailable, unexpected exception.
Parameters
- $message : string|Stringable
- $context : array<string|int, mixed> = []
Return values
void —debug()
Detailed debug information.
public
debug(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string|Stringable
- $context : array<string|int, mixed> = []
Return values
void —emergency()
System is unusable.
public
emergency(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string|Stringable
- $context : array<string|int, mixed> = []
Return values
void —error()
Runtime errors that do not require immediate action but should typically be logged and monitored.
public
error(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string|Stringable
- $context : array<string|int, mixed> = []
Return values
void —info()
Interesting events.
public
info(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Example: User logs in, SQL logs.
Parameters
- $message : string|Stringable
- $context : array<string|int, mixed> = []
Return values
void —interpolate()
Interpolates context values into the message placeholders.
public
static interpolate(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : string
Parameters
- $message : string|Stringable
- $context : array<string|int, mixed> = []
-
[key=>value] array for interpolation of $message
Return values
string —log()
Logs with an arbitrary level
public
log(int|string $level, string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $level : int|string
- $message : string|Stringable
- $context : array<string|int, mixed> = []
-
[key=>value] array for interpolation of $message
Return values
void —notice()
Normal but significant events.
public
notice(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string|Stringable
- $context : array<string|int, mixed> = []
Return values
void —subscribe()
outside actors may subscribe and provide the function to actually log the data
public
static subscribe(callable $action) : void
Parameters
- $action : callable
Return values
void —warning()
Exceptional occurrences that are not errors.
public
warning(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Example: Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong.
Parameters
- $message : string|Stringable
- $context : array<string|int, mixed> = []