Skip to content

dangenendt/logcrawler-client

 
 

Repository files navigation

Laravel Logcrawler Client

Software License PHP from Packagist Downloads StyleCI

Requirement

You will need an account and a project on Logcrawler-Server to be able to use your logcrawler-key here 😉

Installation

First of all, require the package

composer require spresnac/logcrawler-client

Second, publish the default config file

php artisan vendor:publish --tag=logcrawlerclient-config

Configuration

Next, edit your .env so you can put your Logcrawler project key

LOG_CRAWLER_KEY="place_your_key_here"

After this, edit your /config/logging and append this at channels:

Laravel up to 5.7 (including):

'channels' => [
    //...
    'logcrawler' => [
        'driver' => 'monolog',
        'level' => 'debug',
        'handler' => LogCrawler::class,
        'handler_with' => [
            'host' => config('logcrawler.url'),
            'key' => config('logcrawler.key'),
        ],
    ],
    //...
],

Laravel 5.8+ and 6.x:

'channels' => [
    //...
    'logcrawler' => [
        'driver' => 'monolog',
        'level' => 'debug',
        'handler' => LogCrawler::class,
        'with' => [
            'host' => config('logcrawler.url'),
            'key' => config('logcrawler.key'),
        ],
    ],
    //...
],

Last thing, add the logcrawler channel to your selected channel, example:

'stack' => [
    'driver' => 'stack',
    'channels' => ['daily', 'logcrawler'],
    'ignore_exceptions' => false,
],

Finally

Now, your logging to Logcrawler is enabled and you can watch your logs.

Have fun 😎