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
-
logError() public
Log an error to Cake's Log subsystem
-
logException() public
Log an error for an exception with optional request context.
Method Detail
logError() ¶ public
logError(Cake\Error\PhpError $error, Psr\Http\Message\ServerRequestInterface|null $request = null, bool $includeTrace = false): void
Log an error to Cake's Log subsystem
Parameters
-
Cake\Error\PhpError
$error The error to log.
-
Psr\Http\Message\ServerRequestInterface|null
$request optional The request if in an HTTP context.
-
bool
$includeTrace optional Should the log message include a stacktrace.
Returns
void
logException() ¶ public
logException(Throwable $exception, Psr\Http\Message\ServerRequestInterface|null $request = null, bool $includeTrace = false): void
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.
-
bool
$includeTrace optional Should the log message include a stacktrace.
Returns
void