arispati/laravel-log-s3

Laravel library for logging and store it to s3

v0.1.0 2022-03-18 07:53 UTC

This package is auto-updated.

Last update: 2024-11-18 13:27:21 UTC


README

Laravel library for logging and store it to s3

Requirement

  • PHP >= 7.2
  • Laravel >= 5.6

Installation

  • Install with composer
composer require arispati/laravel-log-s3

Export Configuration

php artisan vendor:publish --provider="Arispati\LaravelLogS3\Providers\LaravelLogS3Provider" --tag="config"
<?php

return [
    'disk' => 's3',
    'path' => 'logs',
    'timezone' => 'Asia/Jakarta'
];

Usage

use Arispati\LaravelLogS3\Facades\Log;

// create log name
Log::new('new-log');
// enabled to write file
Log::enabled(true);
// logging
Log::debug('Log Start');
// create a timer
Log::timer('log-start');
// logging with timer duration
Log::debugDuration('Log End', 'log-start');
// write to file
Log::write();

Testing

 ./vendor/bin/phpunit