ycanga/central-logger

Centralized logging package for Laravel

v1.1.1 2025-04-06 14:29 UTC

This package is auto-updated.

Last update: 2025-09-06 15:29:44 UTC


README

A simple Laravel logging driver that sends logs to a central server.

🚀 Installation

  1. Install the package via Composer
   composer require ycanga/central-logger
  1. Publish the configuration file
php artisan vendor:publish --provider="ycanga\CentralLogger\CentralLoggerServiceProvider" --tag="config"

⚙️ Configuration

  1. Add the following environment variables to your .env file:
LOG_CHANNEL=central_logger
LOG_ENDPOINT=[YOUR-CENTRAL-LOGGER-SERVER-ENDPOINT]/api/log
LOG_API_KEY=[YOUR-PROJECT-API-KEY]
  1. Register the logging channel in config/logging.php:
'channels' => [
    // Other channels...

    'central_logger' => [
        'driver' => 'central_logger',
    ],
],

📤 Usage

Once configured, Laravel will send all log messages to your central logger server via the central_logger channel.

You can also log manually using the channel:

Log::channel('central_logger')->info('This is a test log from my project.');

Developed with ❤️ by ycanga