日誌應該知足的要求
中文:app
- 時間戳- 表示事件什麼時候發生
- 格式化- 日誌行應該容易讓人理解,同時便於程序解析
- 日誌地點- 它應該是標準輸出和錯誤,應用不須要關心日誌的地點
- 日誌等級- 日誌事件應該有不一樣的服務等級,大部分狀況下咱們比較關心debug 和info 級別的事件
英文:debug
- timestamps - it is crucial to know which event happened when,
- formatting - log lines must be easily understandable by humans, and straightforward to parse for applications,
- log destination - it should be always the standard output/error, applications should not concern themselves with log routing,
- log levels - log events have different severity levels, in most cases, you won't be interested in debug or info level events.
歡迎關注本站公眾號,獲取更多信息