Giter Club home page Giter Club logo

laravel-logzio's Introduction

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 [email protected]/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.

laravel-logzio's People

Contributors

arku31 avatar cschalenborgh avatar digitalmachinist avatar oanhnn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

laravel-logzio's Issues

Composer preventing installation with php 8

Hi

Issue: Currently can't install or update with PHP 8.0

Latest version 1.1.1 when installed with composer has PHP limited to ^7.1.3 however the GitHub repos shows this has been updated to >=7.1.3

Does this need a new release in order to pick up this change?

Thanks

Tom

Missing Region

Hi!

I created a new account that the endpoint is https://listener-uk.logz.io:8071 and I think this is not yet supported.

Let me know if I can clarify anything more.

Bulk send

Can you please explain what should I do in order to send several logs at once. What's the format?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.