error-tracker / cake-log-target
Error logging to Error Tracker
Installs: 1 318
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 5
Forks: 0
Open Issues: 1
Requires
- cakephp/cakephp: ^3.4
- error-tracker/php-sdk: ^0.1.0
Requires (Dev)
- phpunit/phpunit: ^7
- squizlabs/php_codesniffer: ^3.4
This package is auto-updated.
Last update: 2024-12-12 22:19:42 UTC
README
Who is this for?
This is for Cake PHP developers that need to integrate their applications with Error Tracker. This extension is a log adapter for cake php to send errors and warnings direct to Error Tracker.
Installation
Install this package with composer.
composer require error-tracker/cake-log-target
Configuration
To configure the log
target
in your application, add the below config to your config/app.php
. Whenever
there is a server side error this will be added to the file log as it normally
would. Additionally this will be sent to the error tracker dashboard, for easy
searches, alerts and other handy tools.
/** * Configures logging options */ 'Log' => [ 'debug' => [ 'className' => 'Cake\Log\Engine\FileLog', 'path' => LOGS, 'file' => 'debug', 'levels' => ['notice', 'info', 'debug'], 'url' => env('LOG_DEBUG_URL', null), ], 'error' => [ 'className' => 'Cake\Log\Engine\FileLog', 'path' => LOGS, 'file' => 'error', 'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'], 'url' => env('LOG_DEBUG_URL', null), ], 'error_tracker' => [ 'className' => 'ErrorTracker\Cake\LogTarget', 'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'], 'app_key' => 'YOUR_APP_KEY', ], ],
Contributing
Getting set up
Clone the repo and run composer install
.
Then start hacking!
Testing
All new features of bug fixes must be tested. Testing is with phpunit and can be run with the following command.
composer run-script test
Coding Standards
This library uses psr2 coding standards and squizlabs/php_codesniffer
for
linting. There is a composer script for this:
composer run-script lint
Pull Requests
Before creating a pull request with your changes, the pre-commit script must pass. That can be run as follows:
composer run-script pre-commit
Credits
This package is created and maintained by Practically.io