https://github.com/a5sys/monitorbundle
https://github.com/a5sys/monitorbundle
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/a5sys/monitorbundle
- Owner: A5sys
- License: mit
- Created: 2016-12-19T13:44:58.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-24T10:23:58.000Z (over 8 years ago)
- Last Synced: 2025-02-19T20:16:22.006Z (4 months ago)
- Language: PHP
- Size: 44.9 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Monitor Bundle #
This bundle gives some statistics about the application usage.
You can easily know, day per day:
* how many requests did not end
* the slow requests
* the requests that kills you app performance
# Installation #
## Download ##
Download the bundle using composer:composer require 'a5sys/monitor-bundle'
## Enable bundle ##
Enable the bundle in your /app/AppKernel.php:new A5sys\MonitorBundle\MonitorBundle(),
Note that you also need to enable the jms-translation bundle:new JMS\TranslationBundle\JMSTranslationBundle(),
## Add channel ##
Configure the logger:monolog:
channels: ['monitor']
handlers:
monitor:
type: rotating_file
max_files: 60
path: "%kernel.logs_dir%/monitor.log"
channels: ['monitor']
formatter: monitor.monolog.formatterDo not forget to remove the channel monitor from your main log if you do not want to spam it.
Example:
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.ymlmonitor_controller:
resource: "@MonitorBundle/Controller/"
type: annotation
prefix: /monitor## Security ##
Set up security, in your app/config/security.yml
security:
access_control:
- { path: ^/monitor/, roles: ROLE_SUPER_ADMIN }
## Configuration ##These are the available configurations with their default value:
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.
The statistics can be viewed at the url (depending of your configuration)
http://yourapp/monitor