dakatsuka / monolog-fluent-handler
Fluentd Handler for Monolog
Installs: 477 060
Dependents: 0
Suggesters: 0
Security: 0
Stars: 11
Watchers: 2
Forks: 5
Open Issues: 1
Requires
- php: >=5.3
- fluent/logger: 0.3.*
- monolog/monolog: ~1.6
This package is not auto-updated.
Last update: 2024-12-21 16:25:12 UTC
README
Fluentd Handler for Monolog
Installation
Add this lines to your composer.json:
{ "require": { "dakatsuka/monolog-fluent-handler": "1.2.0" } }
And then execute:
$ php composer.phar install
Usage
<?php use Dakatsuka\MonologFluentHandler\FluentHandler; use Monolog\Logger; $logger = new Logger('dakatsuka'); $logger->pushHandler(new FluentHandler()); $logger->debug('example.monolog', array('foo' => 'bar')); $logger->info('example.fluentd', array('fizz' => 'buzz')); // Fluentd: // 2013-10-11 01:00:00 +0900 dakatsuka.example.monolog: {"foo":"bar","level":"DEBUG"} // 2013-10-11 01:00:00 +0900 dakatsuka.example.fluentd: {"fizz":"buzz","level":"INFO"}
You can specify the host name and port.
<?php $logger = new Logger('dakatsuka'); $logger->pushHandler(new FluentHandler(null, '127.0.0.1', 24224));
You can specify the FluentLogger object.
<?php $fluent = new FluentLogger("localhost", 24224); $logger = new Logger('dakatsuka'); $logger->pushHandler(new FluentHandler($fluent));
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Test
$ make phpunit
$ make test
Copyright
Copyright (C) 2013-2015 Dai Akatsuka, released under the MIT License.