itul / itracklaravel
Error Tracking for sites on Laravel
This package's canonical repository appears to be gone and the package has been frozen as a result.
This package is auto-updated.
Last update: 2023-07-08 04:26:55 UTC
README
Installation
You can install the package via composer:
composer require itul/itracklaravel
Install the project using the included installer
php artisan itrack:install
Installing iTrack
What is your secret key?:
> Enter your key here...
Key accepted.
Updating Environment File...
Environment file updated!
Would you like to send a test exception now? (yes/no) [no]:
> yes
Test Sent.
Your application is setup!
You can obtain your site's auth key from https://itrack.i-tul.com by either creating a new site or viewing an existing one and copying the auth key field.
The last step is to edit your exception handler in laravel.
app/Exceptions/Handler.php
add this code to the render method
$res = new \ITul\ITrackLaravel\ITrackLaravel($request, $exception);
Now errors will automatically feed into iTrack
Config Settings
You can manipulate the error tracking using the included config file config/itrack-laravel.php
Config Variable | .env Equivalent | Data Type | Description |
---|---|---|---|
enabled | ITRACK_ENABLED | bool (default: true) | Allows the entire logger to be turned on/off. |
key | ITRACK_AUTH_KEY | string (default: null) | Authorization key generated by iTrack Main Site |
min_level | ITRACK_LOG_LEVEL | string (default: "error", options: "debug", "info", "notice", "warning", "error", "critical", "alert", "emergency") | Sets which error types should be sent to the main application. |
log_endpoint | ITRACK_LOG_ENDPOINT | string (default: "https://itrack.i-tul.com/api/record") | Ability to change where logs are sent. Can be changed to a requestbin for test purposes. |
test_endpoint | ITRACK_TEST_ENDPOINT | string (default: "https://itrack.i-tul.com/api/test") | Sets the test endpoint for the installer. |
Javascript Console Tracking
To use js console tracking you need to publish the view. This is done automatically via the installer but if you did not use the installer, you will need to publish the assets by doing the following.
php artisan vendor:publish
Now you can include the console tracker in your main layout header
@include('vendor.itrack-laravel.javascript')