interface ThrowableStorageInterface (View source)

An interface for storages that can store full exceptions and their stack traces.

Methods

createWithOptions(array $options)

A factory method to create an instance of the throwable storage.

string
logThrowable(Throwable $throwable, array $additionalData = [])

Stores information about the given exception and returns information about the exception and where the details have been stored. The returned message can be logged or displayed as needed.

setRequestInformationRenderer(Closure $requestInformationRenderer)

Set a closure that returns information about the current request to be stored with the exception.

setBacktraceRenderer(Closure $backtraceRenderer)

Set a closure that takes a backtrace array and returns a representation useful for this storage.

Details

static ThrowableStorageInterface createWithOptions(array $options)

A factory method to create an instance of the throwable storage.

Note that throwable storages must work without proxy so all dependencies need to be resolved manually or via options.

Parameters

array $options

Return Value

ThrowableStorageInterface

string logThrowable(Throwable $throwable, array $additionalData = [])

Stores information about the given exception and returns information about the exception and where the details have been stored. The returned message can be logged or displayed as needed.

Parameters

Throwable $throwable

The throwable to log

array $additionalData

Additional data to log

Return Value

string

Informational message about the stored throwable

ThrowableStorageInterface setRequestInformationRenderer(Closure $requestInformationRenderer)

Set a closure that returns information about the current request to be stored with the exception.

Note this is not yet public API and bound to change.

Parameters

Closure $requestInformationRenderer

Return Value

ThrowableStorageInterface

ThrowableStorageInterface setBacktraceRenderer(Closure $backtraceRenderer)

Set a closure that takes a backtrace array and returns a representation useful for this storage.

Note this is not yet public API and bound to change.

Parameters

Closure $backtraceRenderer

Return Value

ThrowableStorageInterface