Skip to content

ldubois/cake-bugsnag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CakePHP Bugsnag Plugin

CakePHP integration for Bugsnag.

Requirements

  • PHP 7.1+
  • CakePHP 4.0+
  • and Bugsnag account

Installation

With composer install.

composer require ldubois/cake-bugsnag

Usage

Set config files.

Write your Bugsnag account info.

// in `config/app.php`
return [
  'Bugsnag' => [
    'apiKey' => YOUR_Bugsnag_apiKey,
    'userId' => YOUR_SESSION_USER_ID,//default => Auth.User.id in Session
    'userName' => YOUR_SESSION_USER_NAME //default => Auth.User.name in Session
  ]
];

Loading plugin.

In Application.php

public function bootstrap()
{
    parent::bootstrap();

    $this->addPlugin(\ldubois\Bugsnag\Plugin::class);
}

Or use cake command.

bin/cake plugin load ldubois/Bugsnag --bootstrap

That's all! 🎉

Advanced Usage

Ignore noisy exceptions

You can filter out exceptions that make a fuss and harder to determine the issues to address(like PageNotFoundException) Set exceptions not to log in Error.skipLog.

ex)

// in `config/app.php`
'Error' => [
    'skipLog' => [
        NotFoundException::class,
        MissingRouteException::class,
        MissingControllerException::class,
    ],
]

ref: CakePHP Cookbook
https://book.cakephp.org/4/en/development/errors.html#error-exception-configuration

About

CakePHP 4 plugin integration for Bugsnag

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages