```
// 記錄器提供了 7 種在 RFC 5424 標準內定義的記錄等級:
// debug, info, notice, warning, error, critical, and alert.
// 獲取 monolog 實例
Log::getMonolog();
// 添加監聽器
Log::listen(function($level, $message, $context) {});
```
### 寫日志消息
```
Log::emergency($message);
Log::alert($message);
Log::critical($message);
Log::error($message);
Log::warning($message);
Log::notice($message);
Log::info($message);
Log::debug($message);
```
### 上下文信息#
```
Log::info('User failed to login.', ['id' => $user->id]);
```
### 寫入指定通道#
```
Log::channel('slack')->info('Something happened!');
```
- 參考知識--非必學僅供必要時候查詢
- 知識清單
- Composer 安裝等
- artisan--創建模型-控制器-各種模塊
- Route--路由
- Paginate--分頁
- File--文件
- View--視圖
- template--模版
- Model--模型
- Schema--數據表索引-外鍵-字段類型
- DB-基本使用-查詢語句-joins-聚合--原生sql-增刪改查等
- message--消息
- Validation--驗證規則
- Auth-用戶認證-用戶權限
- Helper-數組對象-路徑-字符串-urls-links等
- Session會話
- Response--回應
- Request--請求
- Redirect--重定向
- Environment--環境
- Log--日志
- URL--地址
- Event--事件
- Input--輸入
- Security安全--哈希-加密解密
- Queue--監聽
- Container--容器
- Config--參數設置
- Cache--緩存
- Cookie--設置-獲取--刪除等
- Mail--郵件
- String--字符串
- Collection--集合
- Storage--存儲
- Lang--語言
- 單元測試
- 文件夾結構簡介
- 第一章 laravel8運行環境的搭建(已經有了運行環境的直接跳過)