splash/sonata-admin-monolog-bundle
Composer 安装命令:
composer require splash/sonata-admin-monolog-bundle
包简介
Provide a Doctrine DBAL handler for Monolog with Sonata Admin Implementation. This Bundle is inspired from LexikMonologBrowserBundle.
README 文档
README
This Symfony bundle provides a Doctrine DBAL handler for Monolog Web UI to display log entries is integrated to Sonata Admin UI.
You can list, filter and paginate logs as you can see on the screenshot bellow:
As this bundle query your database on each raised log, it's relevant for small and medium projects, but if you have billion of logs consider using a specific log server.
This Bundle is inspired from LexikMonologBrowserBundle
Requirements:
- Symfony 3.4+ | 4.0+ | 4.2+
- Sonata-Project/AdminBundle
Installation
Installation with composer:
... "require": { ... "splash/sonata-admin-monolog-bundle": "@stable", ... }, ...
Next, be sure to enable these bundles in your Kernel.php file:
public function registerBundles() { return array( // SPLASH SONATA ADMIN MONOLOG BUNDLE new new Splash\SonataAdminMonologBundle\SplashSonataAdminMonologBundle(), // ... ); }
Basic Configuration
Then, you can configure Monolog to use the Doctrine DBAL handler:
# app/config/config.yml # or any env monolog: handlers: database_handler: type: service id: splash.sonata.admin.monolog.handler channels: ["!event"]
Advanced Configuration
If you don't want to use default Doctrine Entity Manager, you need to configure the Doctrine DBAL connection to use in the handler.
You have 2 ways to do that:
By using an existing Doctrine connection:
Note: we set the logging and profiling option to false to avoid DI circular reference.
# app/config/config.yml doctrine: dbal: connections: default: ... monolog: driver: pdo_sqlite dbname: monolog path: %kernel.root_dir%/cache/monolog2.db charset: UTF8 logging: false profiling: false splash_sonata_admin_monolog: doctrine: connection_name: monolog
By creating a custom Doctrine connection for the bundle:
# app/config/config.yml splash_sonata_admin_monolog: doctrine: connection: driver: pdo_sqlite driverClass: ~ pdo: ~ dbname: monolog host: localhost port: ~ user: root password: ~ charset: UTF8 path: %kernel.root_dir%/db/monolog.db # The filesystem path to the database file for SQLite memory: ~ # True if the SQLite database should be in-memory (non-persistent) unix_socket: ~ # The unix socket to use for MySQL
Please refer to the Doctrine DBAL connection configuration for more details.
Now your database is configured, you can generate the schema for your log entry table by running the following command:
php bin/console doctrine:schema:update --force
Translations
If you wish to use default translations provided in this bundle, make sure you have enabled the translator in your config:
# app/config/config.yml framework: translator: ~
Contributing
Any Pull requests are welcome!
This module is part of SplashSync project.
splash/sonata-admin-monolog-bundle 适用场景与选型建议
splash/sonata-admin-monolog-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 625 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 11 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Symfony2」 「monolog」 「logger」 「bundle」 「doctrine」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 splash/sonata-admin-monolog-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 splash/sonata-admin-monolog-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 splash/sonata-admin-monolog-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A GeoIP decorator/processor for monolog
A Zend Framework module that sets up Monolog for logging in applications.
Laravel 5.6 Monolog custom telegram channel
Workflow logger
HTTP request logger middleware for Laravel
A Monolog processor to add X-Request-Id or UNIQUE_ID env to monolog stack if present, provide a default one otherwise. Optionally, add a forwarded request-id list.
统计信息
- 总下载量: 625
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-11-06

