# Monolog - Logging for PHP [![Continuous Integration](https://github.com/Seldaek/monolog/workflows/Continuous%20Integration/badge.svg?branch=main)](https://github.com/Seldaek/monolog/actions)
[![Total Downloads](https://img.shields.io/packagist/dt/monolog/monolog.svg)](https://packagist.org/packages/monolog/monolog)
[![Latest Stable Version](https://img.shields.io/packagist/v/monolog/monolog.svg)](https://packagist.org/packages/monolog/monolog)
Monolog sends your logs to files, sockets, inboxes, databases and various
web services. See the complete list of handlers below. Special handlers
allow you to build advanced logging strategies.
This library implements the [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)
interface that you can type-hint against in your own libraries to keep
a maximum of interoperability. You can also use it in your applications to
make sure you can always use another compatible logger at a later time.
As of 1.11.0 Monolog public APIs will also accept PSR-3 log levels.
Internally Monolog still uses its own level scheme since it predates PSR-3.
## Installation
Install the latest version with
```bash
$ composer require monolog/monolog
```
## Basic Usage
```php
<?php
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
// create a log channel
$log = new Logger('name');
$log->pushHandler(new StreamHandler('path/to/your.log', Logger::WARNING));
// add records to the log
$log->warning('Foo');
$log->error('Bar');
```
## Documentation
- [Usage Instructions](doc/01-usage.md)
- [Handlers, Formatters and Processors](doc/02-handlers-formatters-processors.md)
- [Utility Classes](doc/03-utilities.md)
- [Extending Monolog](doc/04-extending.md)
- [Log Record Structure](doc/message-structure.md)
## Support Monolog Financially
Get supported Monolog and help fund the project with the [Tidelift Subscription](https://tidelift.com/subscription/pkg/packagist-monolog-monolog?utm_source=packagist-monolog-monolog&utm_medium=referral&utm_campaign=enterprise) or via [GitHub sponsorship](https://github.com/sponsors/Seldaek).
Tidelift delivers commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use.
## Third Party Packages
Third party handlers, formatters and processors are
[listed in the wiki](https://github.com/Seldaek/monolog/wiki/Third-Party-Packages). You
can also add your own there if you publish one.
## About
### Requirements
- Monolog `^2.0` works with PHP 7.2 or above, use Monolog `^1.25` for PHP 5.3+ support.
### Support
Monolog 1.x support is somewhat limited at this point and only important fixes will be done. You should migrate to Monolog 2 where possible to benefit from all the latest features and fixes.
### Submitting bugs and feature requests
Bugs and feature request are tracked on [GitHub](https://github.com/Seldaek/monolog/issues)
### Framework Integrations
- Frameworks and libraries using [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)
can be used very easily with Monolog since it implements the interface.
- [Symfony](http://symfony.com) comes out of the box with Monolog.
- [Laravel](http://laravel.com/) comes out of the box with Monolog.
- [Lumen](http://lumen.laravel.com/) comes out of the box with Monolog.
- [PPI](https://github.com/ppi/framework) comes out of the box with Monolog.
- [CakePHP](http://cakephp.org/) is usable with Monolog via the [cakephp-monolog](https://github.com/jadb/cakephp-monolog) plugin.
- [Slim](http://www.slimframework.com/) is usable with Monolog via the [Slim-Monolog](https://github.com/Flynsarmy/Slim-Monolog) log writer.
- [XOOPS 2.6](http://xoops.org/) comes out of the box with Monolog.
- [Aura.Web_Project](https://github.com/auraphp/Aura.Web_Project) comes out of the box with Monolog.
- [Nette Framework](http://nette.org/en/) can be used with Monolog via [contributte/monolog](https://github.com/contributte/monolog) extension.
- [Proton Micro Framework](https://github.com/alexbilbie/Proton) comes out of the box with Monolog.
- [FuelPHP](http://fuelphp.com/) comes out of the box with Monolog.
- [Equip Framework](https://github.com/equip/framework) comes out of the box with Monolog.
- [Yii 2](http://www.yiiframework.com/) is usable with Monolog via the [yii2-monolog](https://github.com/merorafael/yii2-monolog) or [yii2-psr-log-target](https://github.com/samdark/yii2-psr-log-target) plugins.
- [Hawkbit Micro Framework](https://github.com/HawkBitPhp/hawkbit) comes out of the box with Monolog.
- [SilverStripe 4](https://www.silverstripe.org/) comes out of the box with Monolog.
### Author
Jordi Boggiano - <j.boggiano@seld.be> - <http://twitter.com/seldaek><br />
See also the list of [contributors](https://github.com/Seldaek/monolog/contributors) who participated in this project.
### License
Monolog is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
### Acknowledgements
This library is heavily inspired by Python's [Logbook](https://logbook.readthedocs.io/en/stable/)
library, although most concepts have been adjusted to fit to the PHP world.
没有合适的资源?快使用搜索试试~ 我知道了~
PHP、Python、Shell、Mysql、Redis 、Docker、前端 学习 & 实践复盘.zip
共229个文件
php:184个
html:19个
md:7个
需积分: 5 0 下载量 112 浏览量
2024-02-22
12:38:23
上传
评论
收藏 343KB ZIP 举报
温馨提示
PHP、Python、Shell、Mysql、Redis 、Docker、前端 学习 & 实践复盘
资源推荐
资源详情
资源评论
收起资源包目录
PHP、Python、Shell、Mysql、Redis 、Docker、前端 学习 & 实践复盘.zip (229个子文件)
nginx.conf 11KB
.DS_Store 10KB
.DS_Store 6KB
.DS_Store 6KB
.gitignore 19B
007 事件.html 15KB
009 ajax.html 8KB
006 筛选.html 7KB
010 工具.html 7KB
003 选择器.html 6KB
011 事件对象.html 6KB
002 属性 属性.html 4KB
000 jQuery 核心.html 4KB
005 文档处理.html 3KB
004 CSS.html 3KB
008 效果.html 2KB
demo.html 2KB
001 属性 HTML代码_文本_值.html 2KB
012 延迟对象.html 1KB
test.html 1004B
014 form 阻止提交.html 984B
013 HTML DOM 元素、属性、文本.html 848B
position.html 616B
new_demo.html 578B
test0.jpg 5KB
test2.jpg 5KB
test1.jpg 2KB
country.json 168KB
installed.json 6KB
composer.json 3KB
composer.json 562B
composer.json 355B
composer.json 89B
LICENSE 1KB
LICENSE 1KB
LICENSE 1KB
composer.lock 15KB
composer.lock 7KB
CHANGELOG.md 33KB
README.md 5KB
UPGRADE.md 3KB
README.md 3KB
docker —help 速查表.md 2KB
jQuery 核心.md 2KB
README.md 1KB
Logger.php 18KB
ClassLoader.php 14KB
InstalledVersions.php 14KB
common_Check.php 13KB
SocketHandler.php 11KB
SlackRecord.php 10KB
ErrorHandler.php 10KB
PHPConsoleHandler.php 10KB
curl.php 8KB
FingersCrossedHandler.php 8KB
BrowserConsoleHandler.php 8KB
Utils.php 8KB
NormalizerFormatter.php 8KB
PushoverHandler.php 8KB
FilterHandler.php 7KB
TestHandler.php 7KB
SlackHandler.php 7KB
LineFormatter.php 6KB
RotatingFileHandler.php 6KB
NewRelicHandler.php 6KB
debug.php 6KB
DeduplicationHandler.php 6KB
StreamHandler.php 6KB
JsonFormatter.php 5KB
TelegramBotHandler.php 5KB
ElasticsearchHandler.php 5KB
FirePHPHandler.php 5KB
CubeHandler.php 5KB
ChromePHPHandler.php 5KB
ProcessHandler.php 5KB
GelfMessageFormatter.php 5KB
NativeMailerHandler.php 5KB
MongoDBFormatter.php 5KB
LoggerInterfaceTest.php 5KB
BufferHandler.php 5KB
class17.php 5KB
OverflowHandler.php 4KB
TestLogger.php 4KB
HtmlFormatter.php 4KB
class03.php 4KB
redis.php 4KB
SamplingHandler.php 4KB
class18.php 4KB
SyslogUdpHandler.php 4KB
class06.php 4KB
LogglyHandler.php 4KB
SignalHandler.php 4KB
Registry.php 4KB
AmqpHandler.php 4KB
WildfireFormatter.php 4KB
IntrospectionProcessor.php 4KB
SlackWebhookHandler.php 4KB
AbstractSyslogHandler.php 3KB
strategy.php 3KB
LoggerTrait.php 3KB
共 229 条
- 1
- 2
- 3
资源评论
Kwan的解忧杂货铺
- 粉丝: 2w+
- 资源: 3699
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功