dev-master
9999999-dev
MIT
The Requires
Wallogit.com
2017 © Pedro Peláez
This bundle gives some statistics about the application usage., (*1)
You can easily know, day per day:, (*2)
Download the bundle using composer:, (*3)
composer require 'a5sys/monitor-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(),
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']
Set up routing, in your app/config/routing.yml, (*9)
monitor_controller:
resource: "@MonitorBundle/Controller/"
type: annotation
prefix: /monitor
Set up security, in your app/config/security.yml, (*10)
security:
access_control:
- { path: ^/monitor/, roles: ROLE_SUPER_ADMIN }
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
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
MIT