Interface ErrorLoggerInterface
Interface for error logging handlers.
Used by the ErrorHandlerMiddleware and global error handlers to log exceptions and errors.
Namespace: Cake\Error
Method Summary
-
log() public
Log an error for an exception with optional request context.
-
logMessage() public
Log a an error message to the error logger.
Method Detail
log() ¶ public
log(Throwable $exception, Psr\Http\Message\ServerRequestInterface|null $request = null): bool
Log an error for an exception with optional request context.
Parameters
-
Throwable
$exception The exception to log a message for.
-
Psr\Http\Message\ServerRequestInterface|null
$request optional The current request if available.
Returns
bool
logMessage() ¶ public
logMessage(string|int $level, string $message, array $context = []): bool
Log a an error message to the error logger.
Parameters
-
string|int
$level The logging level
-
string
$message The message to be logged.
-
array
$context optional Context.
Returns
bool