class FileStorage implements ThrowableStorageInterface (View source)

Stores detailed information about throwables into files.

Properties

protected Closure $requestInformationRenderer
protected Closure $backtraceRenderer
protected string $storagePath

Methods

createWithOptions(array $options)

Factory method to get an instance.

__construct(string $storagePath)

Create new instance.

setRequestInformationRenderer(Closure $requestInformationRenderer)

No description

setBacktraceRenderer(Closure $backtraceRenderer)

No description

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.

string
generateUniqueReferenceCode()

Generates a reference code for this specific error event to make it findable.

string
renderErrorInfo(Throwable $error, array $additionalData = [])

Get current error post mortem informations with support for error chaining

string
getErrorLogMessage(Throwable $error)

No description

string
renderBacktrace(array $backtrace)

Renders background information about the circumstances of the exception.

string
renderRequestInfo()

Render information about the current request, if possible

Details

static ThrowableStorageInterface createWithOptions(array $options)

Factory method to get an instance.

Parameters

array $options

Return Value

ThrowableStorageInterface

__construct(string $storagePath)

Create new instance.

Parameters

string $storagePath

See also

createWithOptions

ThrowableStorageInterface setRequestInformationRenderer(Closure $requestInformationRenderer)

No description

Parameters

Closure $requestInformationRenderer

Return Value

ThrowableStorageInterface

ThrowableStorageInterface setBacktraceRenderer(Closure $backtraceRenderer)

No description

Parameters

Closure $backtraceRenderer

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.

The returned message follows this pattern: Exception #``` in of : - See also:

Parameters

Throwable $throwable

The throwable to log

array $additionalData

Additional data to log

Return Value

string

Informational message about the stored throwable

protected string generateUniqueReferenceCode()

Generates a reference code for this specific error event to make it findable.

Return Value

string

protected string renderErrorInfo(Throwable $error, array $additionalData = [])

Get current error post mortem informations with support for error chaining

Parameters

Throwable $error
array $additionalData

Return Value

string

protected string getErrorLogMessage(Throwable $error)

No description

Parameters

Throwable $error

Return Value

string

protected string renderBacktrace(array $backtrace)

Renders background information about the circumstances of the exception.

Parameters

array $backtrace

Return Value

string

protected string renderRequestInfo()

Render information about the current request, if possible

Return Value

string