mjkatgithub / monolog-influxdb

InfluxDB Handler for Monolog, which allows to store log messages to a InfluxDB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

monolog-influxdb

InfluxDB Handler for Monolog, which allows to store log messages in InfluxDB.

Install

Via Composer

$ composer require elardvermeulen/monolog-influxdb

Usage

<?php

use InfluxDBHandler\InfluxDBHandler;

$influxDBHandler = new InfluxDBHandler('username','password','influxdb','hostname', '8086','dbname', \Monolog\Logger::DEBUG);

//Create logger
$logger = new \Monolog\Logger('channel');
$logger->pushHandler($influxDBHandler);

// example on how to create a info log
$logger->info("User succesfully logged in.", array('username'  => 'Peter Doe', 'userid'  => 89));

// example on how to create a info log
$logger->warning("Failed login attempt.", array('username'  => 'Peter Doe'));

// example on how to create a info log
$logger->error("Oops, something went horribly wrong.", array('username'  => 'John Doe', 'userid'  => 90));

Change log

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please use the issue tracker.

Requirements

Monolog InfluxDB works with PHP 7.0 or above.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

InfluxDB Handler for Monolog, which allows to store log messages to a InfluxDB

License:GNU General Public License v2.0


Languages

Language:PHP 100.0%