https://github.com/stuzzo/monolog-extender-bundle
Symfony Bundle for Monolog extender library
https://github.com/stuzzo/monolog-extender-bundle
Last synced: 10 months ago
JSON representation
Symfony Bundle for Monolog extender library
- Host: GitHub
- URL: https://github.com/stuzzo/monolog-extender-bundle
- Owner: stuzzo
- Created: 2017-04-06T17:51:17.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-02-02T09:51:43.000Z (over 8 years ago)
- Last Synced: 2025-02-05T07:11:24.813Z (over 1 year ago)
- Language: PHP
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
MonologExtenderBundle
=============
[](https://packagist.org/packages/stuzzo/monolog-extender-bundle)
[](https://packagist.org/packages/stuzzo/monolog-extender-bundle)
The `MonologExtenderBundle` provides integration of the [MonologExtender](https://github.com/stuzzo/monolog-extender)
library into the Symfony framework.
Configuration
=============
This is an example configuration to use mail, stream and html formatter.
```yaml
monolog:
handlers:
main_critical:
type: fingers_crossed
action_level: debug
handler: grouped
excluded_404s:
- ^/
grouped:
type: group
members: [streamed_error, deduplicated, slackwebhook]
streamed_error:
type: rotating_file
max_files: 5
path: "%kernel.logs_dir%/%kernel.environment%_error.log"
level: error
formatter: stuzzo.logger.stream.formatter
deduplicated:
type: deduplication
handler: swift
swift:
type: swift_mailer
from_email: %mailer_sender%
to_email: %mailer_to%
subject: "[PROJECT] - Error %kernel.environment%"
level: error
formatter: stuzzo.logger.html.formatter
content_type: text/html
slackwebhook:
type: slackwebhook
channel: %channel% # You can use a channel (with #channelName) or a user (with @userName)
webhook_url: %hook_url%
level: critical
include_extra: true
formatter: stuzzo.logger.html.formatter
```
This is an example configuration to use slack and html processors.
```yaml
services:
app.processor.slack:
class: Stuzzo\Bundle\MonologExtenderBundle\Processor\SlackUserDataProcessor # Add user info and better formatting
arguments: ["@security.token_storage"]
tags:
- { name: monolog.processor, handler: slackwebhook } # It fires only for slack messages
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }
app.processor.web:
class: Stuzzo\Bundle\MonologExtenderBundle\Processor\WebUserDataProcessor # Add user info and better formatting
arguments: ["@security.token_storage"]
tags:
- { name: monolog.processor, channel: request } # It fires only for channel request
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }
```
License
=======
This bundle is released under the [MIT license](LICENSE)