class FileStorage implements ThrowableStorageInterface (View source)

Stores detailed information about throwables into files.

Properties

protected Closure $requestInformationRenderer
protected Closure $backtraceRenderer
protected string $storagePath
protected int $maximumThrowableDumpAge

The maximum age of throwable dump in seconds, 0 to disable cleaning based on age

protected int $maximumThrowableDumpCount

The maximum number of throwable dumps to store, 0 to disable cleaning based on count

Methods

createWithOptions(array $options)

Factory method to get an instance.

__construct(string $storagePath, int $maximumThrowableDumpAge, int $maximumThrowableDumpCount)

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

void
cleanupThrowableDumps()

Cleans up existing throwable dumps when they are older than the configured maximum age or the oldest ones exceeding the maximum number of dumps allowed.

Details

static ThrowableStorageInterface createWithOptions(array $options)

Factory method to get an instance.

Parameters

array $options

Return Value

ThrowableStorageInterface

__construct(string $storagePath, int $maximumThrowableDumpAge, int $maximumThrowableDumpCount)

Create new instance.

Parameters

string $storagePath
int $maximumThrowableDumpAge
int $maximumThrowableDumpCount

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

protected void cleanupThrowableDumps()

Cleans up existing throwable dumps when they are older than the configured maximum age or the oldest ones exceeding the maximum number of dumps allowed.

Return Value

void