emran / logstash-bundle
Symfony2 Bundle for writing logs to logstash through redis broker/input.
Installs: 1 840
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 2
Forks: 1
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.2
- monolog/monolog: ~1.3
- symfony/config: >=2.1
- symfony/dependency-injection: >=2.1
- symfony/monolog-bridge: >=2.1
- symfony/monolog-bundle: >=2.1
Requires (Dev)
- symfony/yaml: >=2.1
This package is not auto-updated.
Last update: 2024-11-04 16:18:35 UTC
README
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:
"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
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:
public function indexAction() { $this->get('logger')->debug('Loading index page.'); return $this->render('TestBundle:Default:index.html.twig'); }