ErrorLoggerInterface
in
Interface for error logging handlers.
Used by the ErrorHandlerMiddleware and global error handlers to log exceptions and errors.
Table of Contents
Methods
- log() : bool
- Log an error for an exception with optional request context.
- logMessage() : bool
- Log a an error message to the error logger.
Methods
log()
Log an error for an exception with optional request context.
public
log(Throwable $exception[, ServerRequestInterface|null $request = null ]) : bool
Implement logException
instead.
Parameters
- $exception : Throwable
-
The exception to log a message for.
- $request : ServerRequestInterface|null = null
-
The current request if available.
Return values
boollogMessage()
Log a an error message to the error logger.
public
logMessage(string|int $level, string $message[, array<string|int, mixed> $context = [] ]) : bool
Implement logError
instead.
Parameters
- $level : string|int
-
The logging level
- $message : string
-
The message to be logged.
- $context : array<string|int, mixed> = []
-
Context.