Giter VIP home page Giter VIP logo

laravel-loggly's Introduction

Laravel Loggly

Loggly logging and error integration for Laravel 5. Based on laravel-rollbar by jenssegers.

This package is still IN DEVELOPMENT.

Installation

Install using composer:

composer require FoxxMD/loggly

Add the service provider to the 'providers' array in config/app.php:

'FoxxMD\Loggly\LogglyServiceProvider',

Configuration

This package supports configuration through the services configuration file located in app/config/services.php. All configuration variables will be directly passed to Rollbar:

'loggly' => [
    'key' => 'your-loggly-token',
    'level' => 'debug',
    'tags' => ['your-tokens]
],

The level variable defines the minimum log level at which log messages are sent to Loggly.

Usage

To automatically monitor exceptions, simply use the Log facade in your error handler in app/Exceptions/Handler.php:

public function report(Exception $e)
{
    \Log::error($e);

    return parent::report($e);
}

For Laravel 4 installations, this is located in app/start/global.php:

App::error(function(Exception $exception, $code)
{
    Log::error($exception);
});

Your other log messages will also be sent to Loggly:

\Log::debug('Here is some debug information');

laravel-loggly's People

Contributors

foxxmd avatar harry-huddle avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

laravel-loggly's Issues

Fatal Error LogglyHandler::write()

Hi, I got this fatal-error while trying to implement your Service:
PHP Fatal error: Call to protected method Monolog\Handler\LogglyHandler::write() from context 'App\Providers\LoggyServiceProvider' in [root]/app/Providers/LoggyServiceProvider.php

Solved it by removing the invocation of the monolog- write method and adding a Log pushhandler according to this url: http://chris.schalenborgh.be/2014/10/02/pushing-laravel-logs-loggly/

The boot method in LoggyServiceProvider looks like this now:

public function boot() {
        $app = $this->app;
        // Listen to log messages.
        $app['log']->listen(function () use ($app) {
            $logger = \Log::getMonolog();
            $logger->pushHandler($app['loggly.handler']);
        });
} 

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.