Skip to content

MyShellSoftwareLab/larabug-local

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LaraBug

Laravel 5.8/6.x/7.x/8.x package for logging errors to larabug.com

Software License Latest Version on Packagist Build Status Total Downloads

Installation on laravel

You can install the package through Composer.

composer require larabug/larabug

Then publish the config and migration file of the package using artisan.

php artisan vendor:publish --provider="LaraBug\ServiceProvider"

And adjust config file (config/larabug.php) with your desired settings.

Note: by default only production environments will report errors. To modify this edit your larabug configuration.

Installation on lumen

You can install the package through Composer.

composer require larabug/larabug

Copy the config file (larabug.php) to lumen config directory.

php -r "file_exists('config/') || mkdir('config/'); copy('vendor/larabug/larabug/config/larabug.php', 'config/larabug.php');"

And adjust config file (config/larabug.php) with your desired settings.

In bootstrap/app.php you will need to:

  • Uncomment this line:
    $app->withFacades();
  • Register the larabug config file:
    $app->configure('larabug');
  • Register larabug service provider:
    $app->register(LaraBug\ServiceProvider::class);

Configuration variables

All that is left to do is to define 2 env configuration variables.

LB_KEY=
LB_PROJECT_KEY=

LB_KEY is your profile key which authorises your account to the API.

LB_PROJECT_KEY is your project API key which you receive when creating a project.

Get these variables at larabug.com

Reporting unhandled exceptions

You can use LaraBug as a log-channel by adding the following config to the channels section in config/logging.php:

'channels' => [
    // ...
    'larabug' => [
        'driver' => 'larabug',
    ],
],

After that you have configured the LaraBug channel you can add it to the stack section:

'channels' => [
    'stack' => [
        'driver' => 'stack',
        'channels' => ['single', 'larabug'],
    ],
    //...
],

PS: If you are using lumen, maybe you doesn't have the logging.php file. So, you can use default logging file from framework core and make changes above.

php -r "file_exists('config/') || mkdir('config/'); copy('vendor/laravel/lumen-framework/config/logging.php', 'config/logging.php');"

License

The larabug package is open source software licensed under the license MIT

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published