New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

oanhnn/laravel-logzio

Integrate Logz.io into PHP and Laravel 5.6+ Application
67,338 10
Install
composer require oanhnn/laravel-logzio
Latest Version:v1.1.1
PHP:^7.1.3
Older releases:5 · 6
License:MIT
Last Updated:Feb 3, 2023
Links: GitHub  ·  Packagist
Maintainer: oanhnn

Introduction

Build Status Coverage Status Latest Version Total Downloads Requires PHP Software License

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.

Related Packages

coolonce/logger-interface

This package allows you to send data for logging to the HTTP daemon associated w...

4,640 1
imer/laravel-query-table

Laravel plugin for displaying query results as a table with built-in filtering/s...

2,086 0
mitydigital/statamic-logger

Detailed, customisable and human-friendly logging for Statamic.

16,175 2
rap2hpoutre/laravel-epilog

More info in laravel's log

4,567 25
kouz/laravel-log

Laravel package which binds a logger to all events to add generalised logging to...

7 0

Version History

Version Released PHP Laravel License
v1.1.1 ^7.1.3 MIT
v1.1.0 ^7.1.3 MIT
v1.0.2 ^7.1.3 MIT
v1.0.1 ^7.1.3 MIT
v1.0.0 ^7.1.3 MIT