Code Monkey home page Code Monkey logo

monobullet's Introduction

Max13/Monobullet GitHub license

Build Status

Monobullet is simply a Pushbullet handler for Monolog. It will send you (or someone else, or many people) a push when your app logs something.

It includes a nice formatter for when logging an Exception and its stack.

For the record, Pushbullet is a platform allowing you to send a push to one or multiple devices using the mobile app, the web app or REST APIs.

Installation

You can install the latest version with:

$ composer require max13/monobullet

Laravel 5.2 and above/similars

Add these lines to your config/services.php:

'monobullet' => [
    'token' => 'YOUR PUSHBULLET TOKEN',
    'name' => 'NAME OF YOUR APP',
    'recipients' => 'email',
    'level' => Monolog\Logger::INFO,
    'propagate' => true,
    'env' => ['staging', 'production'],
],

Here are the variables references:

  • token: Your Pushbullet api token.
  • name: The name of your app, will be used to make the push's title.
  • recipients: Can either be 1 email address, or an array of email addresses.
  • level: Minimum level to take care. The default is Monolog\Logger:INFO.
  • propagate: When false, if a record is handled, it won't be propagated to other handlers.
  • env: Can either be 1 environment name (like production) or an array of environment name.

Then, add this line to Laravel's config/app.php, inside the providers array:

    Monobullet\MonobulletServiceProvider::class,

/!\ Note that when using Service Provider, Monobullet will be set on the top of the Monolog's handlers, so the bubble parameter is important. After that you're good to go!

Other frameworks

Put this wherever your framework's doc is telling you to do (parameters references are above):

use Monobullet\PushbulletHandler;
// or: use Monobullet\Handler;
use Monolog\Logger;

$logger = new Logger('NAME'); // Will be used as the title of the push
$logger->pushHandler(new PushbulletHandler('PUSHBULLET_TOKEN', $recipients, $level = Logger::INFO, $bubble = false));
$logger->info('This is just a test log'); // You will receive a push saying this content

Issues/PRs/Questions

Feel free to open an issue if you need anything. The same way, don't hesitate to send PRs ;)

When sending a PR, don't forget to add your name in the "Contributors" section of this README.

Authors

Currently, I'm the only author of this package:

  • Adnan RIHAN

Contributors

  • None (yet)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.