https://github.com/phpfour/logstashbundle
A bundle on top of MonologBundle which provides easy logging to logstash.
https://github.com/phpfour/logstashbundle
Last synced: 12 months ago
JSON representation
A bundle on top of MonologBundle which provides easy logging to logstash.
- Host: GitHub
- URL: https://github.com/phpfour/logstashbundle
- Owner: phpfour
- License: mit
- Created: 2013-10-04T12:56:53.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2015-08-07T04:16:10.000Z (over 10 years ago)
- Last Synced: 2025-04-04T12:41:08.031Z (about 1 year ago)
- Language: PHP
- Size: 168 KB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## LogstashBundle
A bundle on top of MonologBundle which provides logging to logstash through redis broker/input.
## Installation
##### Step 1: Download LogstashBundle
Add logstash bundle in your composer.json as below:
```js
"require": {
...
"emran/logstash-bundle": "1.0.0"
}
```
Update/install with this command:
```
php composer.phar update "emran/logstash-bundle"
```
##### Step 2: Enable the bundle
Register the bundle
```php
public function registerBundles()
{
$bundles = array(
...
new Emran\Bundle\LogstashBundle\EmranLogstashBundle(),
);
```
##### Step 3: Activate the main configs
```
# app/config/config.yml
emran_logstash:
redis:
host: localhost
port: 6379
list: logstash
name: myApp
```
## How to use ?
The bundle adds a new handler to the already register logger service, so there shouldn't be any change in the way
you are logging your events:
```php
public function indexAction()
{
$this->get('logger')->debug('Loading index page.');
return $this->render('TestBundle:Default:index.html.twig');
}
```