InMemoryLogWriter extends AbstractWriter
Log writer that writes the log records into a static public class variable for InMemory processing
Table of Contents
Properties
Methods
- __construct() : mixed
- Constructs this log writer
- __wakeup() : mixed
- Deny object deserialization.
- writeLog() : self
- Writes the log record
- formatContextValue() : string
- Escape or quote a value from the context appropriate for the output.
- formatException() : string
- Formats an exception into a string.
- interpolate() : string
- Interpolates context values into the message placeholders.
- lockWriter() : void
- Lock writer and add an info message that there may potentially be more entries.
Properties
$log
public
static array<string|int, LogRecord>
$log
= []
Methods
__construct()
Constructs this log writer
public
__construct([array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $options : array<string|int, mixed> = []
-
Configuration options - depends on the actual log writer
Tags
__wakeup()
Deny object deserialization.
public
__wakeup() : mixed
writeLog()
Writes the log record
public
writeLog(LogRecord $record) : self
Parameters
- $record : LogRecord
-
Log record
Tags
Return values
selfformatContextValue()
Escape or quote a value from the context appropriate for the output.
protected
formatContextValue(string $value) : string
Note: In some output cases, escaping should not be done here but later on output, such as if it's being written to a database for later display.
Parameters
- $value : string
Return values
stringformatException()
Formats an exception into a string.
protected
formatException(Throwable $ex) : string
The format here is nearly the same as just casting an exception to a string, but omits the full class namespace and stack trace, as those get very long.
Parameters
- $ex : Throwable
Return values
stringinterpolate()
Interpolates context values into the message placeholders.
protected
interpolate(string $message[, array<string|int, mixed> $context = [] ]) : string
Parameters
- $message : string
- $context : array<string|int, mixed> = []
Return values
stringlockWriter()
Lock writer and add an info message that there may potentially be more entries.
protected
lockWriter() : void