## 分組日志
> 日志使用 `monolog` 擴展,所以更多用法請參考:[[https://github.com/Seldaek/monolog](https://github.com/Seldaek/monolog)]([https://github.com/Seldaek/monolog](https://github.com/Seldaek/monolog))
項目中使用方法:
```php
// 基本日志類型
app('logger')->error('這是一條錯誤日志');
app('logger')->debug('這是一條調試日志');
app('logger')->info('這是一條信息日志');
// 第二個參數 array 類型,可以記錄上下文。
app('logger')->error('這是一條錯誤日志', ['order'=>$order]);
```
分組通道:
```php
app('logger');
app('logger.pay');
app('logger.order');
app('logger.power');
app('logger.goods');
app('logger.packet');
// ...
```
> 框架在自動加載過程中,注冊了多個日志通道,可以按需選擇。注意:實際項目可能有所不同。日志自動記錄了。
框架注冊日志通道時,自動為每個通道增加了 `php` 調用回溯,方便定位問題。