Neuron-PHP

Psr3Adapter
in package
implements LoggerInterface

PSR-3 LoggerInterface adapter for Neuron Logger.

This adapter allows Neuron's logging system to be used anywhere a PSR-3 compliant logger is expected. It translates PSR-3 log calls to Neuron's ILogger interface, maintaining full compatibility while preserving Neuron's advanced features.

Tags
example
// Create a Neuron logger
$neuronLogger = new Logger($destination);

// Wrap it with the PSR-3 adapter
$psr3Logger = new Psr3Adapter($neuronLogger);

// Use with any PSR-3 expecting code
$symfonyComponent = new Component($psr3Logger);

Table of Contents

Interfaces

LoggerInterface

Properties

$logger  : ILogger

Methods

__construct()  : mixed
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.
getNeuronLogger()  : ILogger
Get the underlying Neuron logger.
info()  : void
Interesting events.
log()  : void
Logs with an arbitrary level.
notice()  : void
Normal but significant events.
warning()  : void
Exceptional occurrences that are not errors.
mapPsr3Level()  : RunLevel
Maps PSR-3 log level to Neuron RunLevel.

Properties

Methods

alert()

Action must be taken immediately.

public alert(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string|Stringable
$context : array<string|int, mixed> = []

critical()

Critical conditions.

public critical(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string|Stringable
$context : array<string|int, mixed> = []

debug()

Detailed debug information.

public debug(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string|Stringable
$context : array<string|int, mixed> = []

emergency()

System is unusable.

public emergency(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string|Stringable
$context : array<string|int, mixed> = []

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> = []

getNeuronLogger()

Get the underlying Neuron logger.

public getNeuronLogger() : ILogger

This allows access to Neuron-specific features while still maintaining PSR-3 compatibility.

Return values
ILogger

info()

Interesting events.

public info(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string|Stringable
$context : array<string|int, mixed> = []

log()

Logs with an arbitrary level.

public log(mixed $level, string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$level : mixed
$message : string|Stringable
$context : array<string|int, mixed> = []
Tags
throws
InvalidArgumentException

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> = []

warning()

Exceptional occurrences that are not errors.

public warning(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string|Stringable
$context : array<string|int, mixed> = []

mapPsr3Level()

Maps PSR-3 log level to Neuron RunLevel.

private mapPsr3Level(mixed $level) : RunLevel
Parameters
$level : mixed
Tags
throws
InvalidArgumentException
Return values
RunLevel

        
On this page

Search results