2017 © Pedro Peláez
 

symfony-bundle monitor-bundle

image

a5sys/monitor-bundle

  • Tuesday, January 24, 2017
  • by thomasbeaujean
  • Repository
  • 3 Watchers
  • 1 Stars
  • 193 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 3 % Grown

The README.md

Monitor Bundle

This bundle gives some statistics about the application usage., (*1)

You can easily know, day per day:, (*2)

  • how many requests did not end
  • the slow requests
    • the requests that kills you app performance

Installation

Download

Download the bundle using composer:, (*3)

composer require 'a5sys/monitor-bundle'

Enable bundle

Enable the bundle in your /app/AppKernel.php:, (*4)

new A5sys\MonitorBundle\MonitorBundle(),

Note that you also need to enable the jms-translation bundle:, (*5)

new JMS\TranslationBundle\JMSTranslationBundle(),

Add channel

Configure the logger:, (*6)

monolog:
    channels: ['monitor']
    handlers:        
        monitor:
            type:  rotating_file
            max_files: 60
            path:  "%kernel.logs_dir%/monitor.log"
            channels: ['monitor']
            formatter: monitor.monolog.formatter

Do not forget to remove the channel monitor from your main log if you do not want to spam it., (*7)

Example:, (*8)

monolog:
    handlers:
        main:
            type: rotating_file
            max_files: 60
            path:   "%kernel.logs_dir%/%kernel.environment%.log"
            level:  debug
            channels: [!'monitor']

Routing

Set up routing, in your app/config/routing.yml, (*9)

monitor_controller:
    resource: "@MonitorBundle/Controller/"
    type:     annotation
    prefix:   /monitor

Security

Set up security, in your app/config/security.yml, (*10)

security:
    access_control:
        - { path: ^/monitor/, roles: ROLE_SUPER_ADMIN }

Configuration

These are the available configurations with their default value:, (*11)

monitor:
    enable: true #enable or disable the logs
        slow_threshold:
            warning: 1000 #the requests that needs more than X ms is a slow one
            error: 3000 #the requests that needs more than X ms is an error, it takes too much time
types:
    start: true #is the start time for the request log required
    stop: true #is the stop time for the request log required
    duration: true #is the duration for the request log required
    memory: true #is the memory for the request log required
    url: true #is the url for the request log required
    user: true #is the user for the request log required

Usage

The monitor logs are in your app/logs folder., (*12)

The statistics can be viewed at the url (depending of your configuration), (*13)

http://yourapp/monitor

The Versions

24/01 2017

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

19/12 2016

V1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires