A simple hello world composer package

1.0.3 2020-08-17 03:12 UTC

This package is auto-updated.

Last update: 2024-04-17 20:22:48 UTC


README

A package to send logs to a server via udp or tcp.

It uses the new Laravel custom log channel introduced in Laravel 5.6.

Table of contents

Installation

Install via composer

composer require litermi/elasticlog

add row in config/app.php

 \Cirelramostrabajo\Plogger\ElasticServiceProvider::class

publish config

php artisan vendor:publish --provider="Cirelramostrabajo\Plogger\Providers\ElasticServiceProvider"

Edit config/logging.php to add the new logger logs channel.

return [
        'tcp-logger'   => [
            'name'   => 'elastic',
            'driver' => 'custom',
            'via'    => \Cirelramostrabajo\Plogger\Services\Logs\SendLogTcpMonolog::class,
        ],
        'udp-logger'     => [
            'driver'  => 'monolog',
            'handler' => \Cirelramostrabajo\Plogger\Services\Logs\SendLogUdpJsonHandler::class,
        ],
];

Usage

Once you have modified the Laravel logging configuration, you can send log channel via tcp or udp as any Laravel log channel.

Example

LOG_CHANNEL=tcp-logger
or
LOG_CHANNEL=udp-logger

License

litermi elastic is released under the MIT Licence. See the bundled LICENSE file for details.