https://github.com/ccaglayan/elasticsearch-for-monolog
https://github.com/ccaglayan/elasticsearch-for-monolog
elastic elasticsearch log logging monolog monolog-formatter monolog-handler psr-4
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ccaglayan/elasticsearch-for-monolog
- Owner: ccaglayan
- License: mit
- Created: 2020-03-10T03:27:48.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-10T13:21:08.000Z (about 5 years ago)
- Last Synced: 2024-07-30T20:05:32.012Z (10 months ago)
- Topics: elastic, elasticsearch, log, logging, monolog, monolog-formatter, monolog-handler, psr-4
- Language: PHP
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Elasticsearch For Monolog
A Monolog handler and formatter that makes use of the elasticsearch/elasticsearch package
#### Composer require command
`composer require ccaglayan/elasticsearch-for-monolog`## Usage
It is fairly easy to use. I'll throw in an example.
```php
use Elasticsearch\ClientBuilder;
use Monolog\Logger;$config = ['127.0.0.1:9200'];
$client = ClientBuilder::create()->setHosts($config)->build();
$options = [
'index' => 'logs_monolog',
'type' => 'logs_doc'
];
$handler = new \ElasticSearch4Monolog\Handler\ElasticsearchHandler($client, $options);
$logger = new Logger('monologElastic');
$logger->pushHandler($handler);
```## Contributing
Pull requests and issues are open!## License
Elasticsearch For Monolog handler is released under the MIT License. See the bundled LICENSE file for details.