Menu

## Exceptions extends BaseConfig
in package

Exceptions.php : 14

Setup how the exception handler works.

### Table of Contents

#### Properties

$deprecationLogLevel : string
  -------------------------------------------------------------------------- LOG LEVEL THRESHOLD FOR DEPRECATIONS -------------------------------------------------------------------------- If `$logDeprecations` is set to `true`, this sets the log level to which the deprecation will be logged. This should be one of the log levels recognized by PSR-3.
$errorViewPath : string
  -------------------------------------------------------------------------- Error Views Path -------------------------------------------------------------------------- This is the path to the directory that contains the 'cli' and 'html' directories that hold the views used to generate errors.
$ignoreCodes : array<int, int>
  -------------------------------------------------------------------------- DO NOT LOG STATUS CODES -------------------------------------------------------------------------- Any status codes here will NOT be logged if logging is turned on.
$log : bool
  -------------------------------------------------------------------------- LOG EXCEPTIONS? -------------------------------------------------------------------------- If true, then exceptions will be logged through Services::Log.
$logDeprecations : bool
  -------------------------------------------------------------------------- WHETHER TO THROW AN EXCEPTION ON DEPRECATED ERRORS -------------------------------------------------------------------------- If set to `true`, DEPRECATED errors are only logged and no exceptions are thrown. This option also works for user deprecations.
$sensitiveDataInTrace : array<int, string>
  -------------------------------------------------------------------------- HIDE FROM DEBUG TRACE -------------------------------------------------------------------------- Any data that you would like to hide from the debug trace.

#### Methods

handler() : ExceptionHandlerInterface

### Properties

#### $deprecationLogLevel

Exceptions.php : 81

-------------------------------------------------------------------------- LOG LEVEL THRESHOLD FOR DEPRECATIONS -------------------------------------------------------------------------- If `$logDeprecations` is set to `true`, this sets the log level to which the deprecation will be logged. This should be one of the log levels recognized by PSR-3.

`public string $deprecationLogLevel = \Psr\Log\LogLevel::WARNING`

The related `Config\Logger::$threshold` should be adjusted, if needed, to capture logging the deprecations.

#### $errorViewPath

Exceptions.php : 47

-------------------------------------------------------------------------- Error Views Path -------------------------------------------------------------------------- This is the path to the directory that contains the 'cli' and 'html' directories that hold the views used to generate errors.

`public string $errorViewPath = APPPATH . 'Views/errors'`

Default: APPPATH.'Views/errors'

#### $ignoreCodes

Exceptions.php : 36

-------------------------------------------------------------------------- DO NOT LOG STATUS CODES -------------------------------------------------------------------------- Any status codes here will NOT be logged if logging is turned on.

`public array<int, int> $ignoreCodes = [404]`

By default, only 404 (Page Not Found) exceptions are ignored.

#### $log

Exceptions.php : 25

-------------------------------------------------------------------------- LOG EXCEPTIONS? -------------------------------------------------------------------------- If true, then exceptions will be logged through Services::Log.

`public bool $log = true`

Default: true

#### $logDeprecations

Exceptions.php : 68

-------------------------------------------------------------------------- WHETHER TO THROW AN EXCEPTION ON DEPRECATED ERRORS -------------------------------------------------------------------------- If set to `true`, DEPRECATED errors are only logged and no exceptions are thrown. This option also works for user deprecations.

`public bool $logDeprecations = true`

#### $sensitiveDataInTrace

Exceptions.php : 59

-------------------------------------------------------------------------- HIDE FROM DEBUG TRACE -------------------------------------------------------------------------- Any data that you would like to hide from the debug trace.

`public array<int, string> $sensitiveDataInTrace = []`

In order to specify 2 levels, use "/" to separate. ex. ['server', 'setup/password', 'secret_token']

### Methods

#### handler()

Exceptions.php : 102
`public handler(int $statusCode, Throwable $exception) : ExceptionHandlerInterface`

##### Parameters

$statusCode : int
$exception : Throwable

##### Return values

ExceptionHandlerInterface

## Search results