azurre/php-logger-sender

There is no license information available for the latest version (1.0.1) of this package.

1.0.1 2021-05-24 14:23 UTC

This package is auto-updated.

Last update: 2022-11-24 17:17:30 UTC


README

Send logs files content to logs collector

Installation

composer require azurre/php-logger-sender:"^1.0"

Usage

$loader = include __DIR__ . '/vendor/autoload.php';
$sender = new \Azurre\Component\Logger\Sender(include __DIR__ . '/config.php');
try {
    $sender->run();
} catch (\Exception $e) {
    echo "Error: {$e->getMessage()}";
}

Config example

<?php
return [
    'api' => 'https://logger.site.com/api/',
    'token' => '41689fe08fg67507e857d5248dc89388',
    'storages' => [
        __DIR__ . '/ram_drive/logs/',
        __DIR__ . '/logs/'
    ],
    'max_iterations' => 10,
];