itul/itracklaravel

Error Tracking for sites on Laravel

1.1.2 2019-08-06 20:24 UTC

This package is auto-updated.

Last update: 2023-07-08 04:26:55 UTC


README

Latest Stable Version Total Downloads

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 EquivalentData TypeDescription
enabledITRACK_ENABLEDbool (default: true)Allows the entire logger to be turned on/off.
keyITRACK_AUTH_KEYstring (default: null)Authorization key generated by iTrack Main Site
min_levelITRACK_LOG_LEVELstring (default: "error", options: "debug", "info", "notice", "warning", "error", "critical", "alert", "emergency")Sets which error types should be sent to the main application.
log_endpointITRACK_LOG_ENDPOINTstring (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_endpointITRACK_TEST_ENDPOINTstring (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')