Download the PHP package pozitronik/yii2-exceptionslogger without Composer
On this page you can find all versions of the php package pozitronik/yii2-exceptionslogger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pozitronik/yii2-exceptionslogger
More information about pozitronik/yii2-exceptionslogger
Files in pozitronik/yii2-exceptionslogger
Package yii2-exceptionslogger
Short Description Exception logger for YII2
License GPL-3.0-or-later
Informations about the package yii2-exceptionslogger
ExceptionsLogger
Exceptions logging extension for YII2
Installation
The preferred way to install this extension is through composer.
Run
or add
to the require section of your composer.json
file.
Requirements
Yii2, PHP >= 8.0
Configuration
Run a included migration:
It creates the sys_exceptions
table, which will store exceptions data.
Usage
Direct logger
This extension provides the SysExceptions::log()
function, that can accept any Throwable
interface as its first parameter. The exception
data will be saved in sys_exceptions
table (in case of failure, the data will be written into runtime/exception.log
file).
Example:
Default exceptions handler
You can use the pozitronik\sys_exceptions\models\ErrorHandler
class as default application error handler to log all exceptions
automatically. Define it in your application config, like:
How to add custom data to a log record?
It is possible to add custom string data (e.g. some trace identifier) to every logged error. Configure the customDataHandler
parameter for
the SysExceptionsModule
module:
The data will be stored in the custom_data
text field.
License
GNU GPL v3.0
All versions of yii2-exceptionslogger with dependencies
pozitronik/yii2-traits Version ^1.0.5
pozitronik/yii2-helpers Version ^1.0.9
kartik-v/yii2-grid Version ^3.5.0
kartik-v/yii2-date-range Version ^1.7.0
vlucas/phpdotenv Version 5.5.x-dev