MiniLog
in package
Manage all log message information types.
Tags
Table of Contents
- DEFAULT_CHANNEL = 'master'
- LIMIT = 5000
- $channel : string
- Current channel.
- $context : array<string|int, mixed>
- $data : array<string|int, mixed>
- Contains the log data.
- $storage : MiniLogStorageInterface
- $translator : Translator|null
- __construct() : mixed
- clear() : mixed
- Clears all data for one or all channels.
- critical() : mixed
- Critical conditions.
- debug() : mixed
- Detailed debug information.
- error() : mixed
- Runtime errors that do not require immediate action but should typically be logged and monitored.
- getContext() : string
- Gets the stored context value for a given key.
- info() : mixed
- Interesting information, advices.
- notice() : mixed
- Normal but significant events.
- read() : array<string|int, mixed>
- Returns all messages for a given channel (or all channels) and some levels.
- save() : bool
- Stores all messages on the default storage.
- setContext() : mixed
- Sets the context value for a given key.
- setStorage() : mixed
- Sets a new storage.
- warning() : mixed
- Exceptional occurrences that are not errors.
- reduce() : mixed
- Saves on the default storage and clear all data.
- log() : mixed
- Logs with an arbitrary level.
Constants
DEFAULT_CHANNEL
public
mixed
DEFAULT_CHANNEL
= 'master'
LIMIT
public
mixed
LIMIT
= 5000
Properties
$channel
Current channel.
private
string
$channel
$context
private
static array<string|int, mixed>
$context
= []
$data
Contains the log data.
private
static array<string|int, mixed>
$data
= []
$storage
private
static MiniLogStorageInterface
$storage
$translator
private
Translator|null
$translator
Methods
__construct()
public
__construct([string $channel = '' ][, mixed $translator = null ]) : mixed
Parameters
- $channel : string = ''
- $translator : mixed = null
Return values
mixed —clear()
Clears all data for one or all channels.
public
static clear([string $channel = '' ]) : mixed
Parameters
- $channel : string = ''
Return values
mixed —critical()
Critical conditions.
public
critical(string $message[, array<string|int, mixed> $context = [] ]) : mixed
Example: Application component unavailable, unexpected exception.
Parameters
- $message : string
- $context : array<string|int, mixed> = []
Return values
mixed —debug()
Detailed debug information.
public
debug(string $message[, array<string|int, mixed> $context = [] ]) : mixed
Parameters
- $message : string
- $context : array<string|int, mixed> = []
Return values
mixed —error()
Runtime errors that do not require immediate action but should typically be logged and monitored.
public
error(string $message[, array<string|int, mixed> $context = [] ]) : mixed
Parameters
- $message : string
- $context : array<string|int, mixed> = []
Return values
mixed —getContext()
Gets the stored context value for a given key.
public
static getContext(string $key) : string
Parameters
- $key : string
Return values
string —info()
Interesting information, advices.
public
info(string $message[, array<string|int, mixed> $context = [] ]) : mixed
Parameters
- $message : string
- $context : array<string|int, mixed> = []
Return values
mixed —notice()
Normal but significant events.
public
notice(string $message[, array<string|int, mixed> $context = [] ]) : mixed
Parameters
- $message : string
- $context : array<string|int, mixed> = []
Return values
mixed —read()
Returns all messages for a given channel (or all channels) and some levels.
public
static read([string $channel = '' ][, array<string|int, mixed> $levels = [] ]) : array<string|int, mixed>
Parameters
- $channel : string = ''
- $levels : array<string|int, mixed> = []
Return values
array<string|int, mixed> —save()
Stores all messages on the default storage.
public
static save([string $channel = '' ]) : bool
Parameters
- $channel : string = ''
Return values
bool —setContext()
Sets the context value for a given key.
public
static setContext(string $key, string $value) : mixed
Parameters
- $key : string
- $value : string
Return values
mixed —setStorage()
Sets a new storage.
public
static setStorage(MiniLogStorageInterface $storage) : mixed
Parameters
- $storage : MiniLogStorageInterface
Return values
mixed —warning()
Exceptional occurrences that are not errors.
public
warning(string $message[, array<string|int, mixed> $context = [] ]) : mixed
Example: Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong.
Parameters
- $message : string
- $context : array<string|int, mixed> = []
Return values
mixed —reduce()
Saves on the default storage and clear all data.
protected
reduce() : mixed
Return values
mixed —log()
Logs with an arbitrary level.
private
log(string $level, string $message[, array<string|int, mixed> $context = [] ]) : mixed
Parameters
- $level : string
- $message : string
- $context : array<string|int, mixed> = []