All Projects → codex-team → hawk.php

codex-team / hawk.php

Licence: MIT license
PHP Errors catching and monitoring

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to hawk.php

composer-normalize-action
+ 🎵 Provides a GitHub action for running ergebnis/composer-normalize.
Stars: ✭ 25 (+38.89%)
Mutual labels:  composer
generator-composer
🐘 Yeoman (http://yeoman.io) generator for a PHP Composer project
Stars: ✭ 16 (-11.11%)
Mutual labels:  composer
PhpBotFramework
A framework for Telegram Bot API written in PHP.
Stars: ✭ 56 (+211.11%)
Mutual labels:  composer
HandlebarsCookbook
A cookbook of handlebars and mustache, focus on handlebars.js , mustache.js and lightncandy usage
Stars: ✭ 20 (+11.11%)
Mutual labels:  composer
routing
Aplus Framework Routing Library
Stars: ✭ 186 (+933.33%)
Mutual labels:  composer
acme2
Another PHP client for acme protocal (version 2) implementation, used for generating letsencrypt's free ssl certificates.
Stars: ✭ 45 (+150%)
Mutual labels:  composer
cygnite-application
Cygnite PHP Framework- Skeleton Application
Stars: ✭ 26 (+44.44%)
Mutual labels:  composer
weapp wechat miniapp sdk
一个封装了微信小程序服务端接口的SDK
Stars: ✭ 102 (+466.67%)
Mutual labels:  composer
tug
Private Composer registry for private PHP packages on AWS Serverless
Stars: ✭ 33 (+83.33%)
Mutual labels:  composer
composer-localdev-plugin
Composer Plugin for local development
Stars: ✭ 31 (+72.22%)
Mutual labels:  composer
license-checker-php
CLI tool to verify used licenses in composer dependencies
Stars: ✭ 28 (+55.56%)
Mutual labels:  composer
composer-file-loader
Tool to load namespaces and classes from composer.json file without composer
Stars: ✭ 64 (+255.56%)
Mutual labels:  composer
packagist
🐳 Dockette out-of-box Packagist (Nginx / Solr 6 / PHP 7.1+FPM)
Stars: ✭ 32 (+77.78%)
Mutual labels:  composer
pagination
Aplus Framework Pagination Library
Stars: ✭ 167 (+827.78%)
Mutual labels:  composer
TCSTK-Angular
TIBCO Cloud™ Composer - Angular Libraries
Stars: ✭ 12 (-33.33%)
Mutual labels:  composer
selene
A opinionated Wordpress base theme based on Sage.
Stars: ✭ 31 (+72.22%)
Mutual labels:  composer
ubiquity-devtools
Command line tools for Ubiquity framework
Stars: ✭ 12 (-33.33%)
Mutual labels:  composer
Minecraft-Skin-Renderer
Minecraft 3D Skin renderer with composer support and flexible rotation configuration
Stars: ✭ 14 (-22.22%)
Mutual labels:  composer
geoip2-geolite2-composer
This project aims to provide an easy solution to require GeoIP2 / GeoLite2 databases inside your project using composer.
Stars: ✭ 15 (-16.67%)
Mutual labels:  composer
gh-auto-updater
Automatic Updater with GitHub API for WordPress Plugin
Stars: ✭ 42 (+133.33%)
Mutual labels:  composer

Hawk PHP

PHP errors Catcher for Hawk.so.

Setup

  1. Register an account, create a Project and get an Integration Token.

  2. Install SDK via composer to install the Catcher

Catcher provides support for PHP 7.2 or later

$ composer require codex-team/hawk.php

Configuration

\Hawk\Catcher::init([
    'integrationToken' => 'your integration token'
]);

After initialization you can set user or context for any event that will be send to Hawk

\Hawk\Catcher::get()
    ->setUser([
        'name' => 'user name',
        'photo' => 'user photo',
    ])
    ->setContext([
        ...
    ]);

Send events and exceptions manually

Use sendException method to send any caught exception

try {
    throw new Exception("Error Processing Request", 1);
} catch (Exception $e) {
    \Hawk\Catcher::get()->sendException($e);
}

Use sendEvent method to send any data (logs, notices or something else)

\Hawk\Catcher::get()->sendMessage('your message', [
    ... // Context
]);

Filtering sensitive information

Use the beforeSend hook to filter any data you don't want to send to Hawk. Use setters to clear any property.

\Hawk\Catcher::init([
    // ...
    'beforeSend' => function (\Hawk\EventPayload $eventPayload) {
        $user = $eventPayload->getUser();
        
        if (!empty($user['email'])){
            unset($user['email']);
        
            $eventPayload->setUser($user);
        }

        return $eventPayload;
    }
]);

Issues and improvements

Feel free to ask questions or improve the project.

Links

Repository: https://github.com/codex-team/hawk.php

Report a bug: https://github.com/codex-team/hawk.php/issues

Composer Package: https://packagist.org/packages/codex-team/hawk.php

CodeX Team: https://ifmo.su

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].