Receive exceptions from client websites
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
tests
.gitignore
CHANGELOG.md
README.md
UPGRADE.md
composer.json
composer.lock
test.php

README.md

LUYA Logo

Error API Module

LUYA Latest Stable Version Total Downloads Slack Support

For a solid and secure website, it is important to get notified about all the errors and exceptions that occur. This helps prevent unnoticed repeating errors and keeps customers happy as they won't have to complain.

With the Error Api module, you can send all exceptions to your personal Error Api and get notify by email or Slack. If an exception occurs on the customer website, you will be notified with the full error stack and a slack notification will be sent (if configured).

Installation

For the installation of modules Composer is required.

Composer

composer require luyadev/luya-module-errorapi:~1.0.0

Configuration

After installation via Composer include the module to your configuration file within the modules section.

'modules' => [
    // ...
    'errorapi' => [
        'class' => 'luya\errorapi\Module',
        'recipient' => ['errors@example.com'],
        'slackToken' => 'YOUR_SECRET_SLACK_TOKEN',
    ],
]

Defined the email of the recipient for the exceptions and setup the slack channel if needed too.

Removing the slack part will disabled slack notifications.

To enable the error api for your website you need to configure the default LUYA error handler in the component section of your config file.

'components' => [
    // ...
    'errorHandler' => [
        'api' => 'https://example.com/errorapi', // where example is the domain you have setup error api above
        'transferException' => true,
    ],
]

Initialization

After successfully installation and configuration run the migrate, import and setup command to initialize the module in your project.

1.) Migrate your database.

./vendor/bin/luya migrate

2.) Import the module and migrations into your LUYA project.

./vendor/bin/luya import

It is very important to run the ./vendor/bin/luya migrate and ./vendor/bin/luya import commands in order for these changes to take effect.