loghouse-io/loghouse-laravel

1.0.4 2021-09-27 11:14 UTC

This package is auto-updated.

Last update: 2024-11-05 18:28:58 UTC


README

Latest Version on Packagist Total Downloads

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

  1. 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}
  1. Next, add a new log channel to logging.php
'channels' => [
        ...
        'loghouse' => [
            'driver' => 'custom',
            'via' => \LoghouseIo\LoghouseLaravel\LoghouseLaravelFactory::class
        ]
  1. And at the end add this channel to the stack
'channels' => [
        ...
        'stack' => [
            'driver' => 'stack',
            'channels' => [...,'loghouse'],
            ...
        ]
  1. 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}
        ]
  1. 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.