loghouse-io / loghouse-laravel
1.0.4
2021-09-27 11:14 UTC
Requires
- php: ^7.2.5|^8.0
This package is auto-updated.
Last update: 2024-11-05 18:28:58 UTC
README
LogHouse is a logging management system that allows you to store hundreds of gigabytes of logs with almost no configuration and with blazing fast ingestion and querying speed.
This library provides integration for Laravel framework.
Installation
You can install the package via composer:
composer require loghouse-io/loghouse-laravel
Usage
- You need to add 2 parameters to the .env file
LOGHOUSE_LARAVEL_ACCESS_TOKEN=${LOGHOUSE_LARAVEL_ACCESS_TOKEN}
LOGHOUSE_LARAVEL_DEFAULT_BUCKET_ID=${LOGHOUSE_LARAVEL_DEFAULT_BUCKET_ID}
- Next, add a new log channel to logging.php
'channels' => [ ... 'loghouse' => [ 'driver' => 'custom', 'via' => \LoghouseIo\LoghouseLaravel\LoghouseLaravelFactory::class ]
- And at the end add this channel to the stack
'channels' => [ ... 'stack' => [ 'driver' => 'stack', 'channels' => [...,'loghouse'], ... ]
- If you want to send logs to another bucket, for example, separate api, web and console logs, you must create a new channel in logging.php, and add bucket_id to the channel config
'channels' => [ ... 'loghouse_api' => [ 'driver' => 'custom', 'via' => \LoghouseIo\LoghouseLaravel\LoghouseLaravelFactory::class, 'bucket_id' => ${bucket_id} ]
- To use the new channel, paste the code into your project
Log::channel('loghouse_api')->warning('Api log');
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.