oanhnn / laravel-logzio
Integrate Logz.io into PHP and Laravel 5.6+ Application
Installs: 51 225
Dependents: 0
Suggesters: 0
Security: 0
Stars: 10
Watchers: 3
Forks: 6
Open Issues: 1
Requires
- php: ^7.1.3
- guzzlehttp/guzzle: ^6.3|^7.0
- monolog/monolog: ^1.12|^2.0
- psr/log: ^1.1
Requires (Dev)
- illuminate/contracts: ^6.20|^7.29|^8.12
- illuminate/support: ^6.20|^7.29|^8.12
- orchestra/testbench: ^4.0|^5.0|^6.0
- phpunit/phpunit: ^8.5|^9.0
README
Easy integrate Logz.io into PHP and Laravel 5.6+ Application
Main features
- Make Logz.io handler for Monolog
- Make
logzio
driver for integrate Logz.io into Laravel Application
Requirements
- php >=7.1.3
- Laravel 6.0+ (when using with Laravel)
We tested with Laravel 6.0+ and php 7.2+ . But it can working with Laravel 5.6+ and php >= 7.1.3
Installation
Begin by pulling in the package through Composer.
$ composer require oanhnn/laravel-logzio
Usage
PHP (non Laravel)
<?php use Laravel\Logzio\Log\Handler; use Monolog\Logger; $config = [ 'token' => '...', 'type' => 'http-bulk', 'ssl' => true, 'region' => '', ]; $logger = new Logger('log-name'); $logger->pushHandler(new Handler(Logger::DEBUG, true, $config); $logger->info('Some message');
Laravel
In config/logging.php
file, config you log with driver logzio
<?php return [ // ... 'custom' => [ 'driver' => 'logzio', 'name' => 'channel-name', 'token' => 'logz-access-token', 'type' => 'http-bulk', 'ssl' => true, 'level' => 'info', 'bubble' => true, 'region' => 'eu', // leave empty for default region 'timestamp_format' => '', // leave empty for default format (requires UTC time) ], // ... ];
In your code using
Log::channel('custom')->info('Some message');
See more in Laravel document
Changelog
See all change logs in CHANGELOG
Testing
$ git clone git@github.com/oanhnn/laravel-logzio.git /path $ cd /path $ composer install $ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email to Oanh Nguyen instead of using the issue tracker.
Credits
License
This project is released under the MIT License.
Copyright © 2020 Oanh Nguyen.