日志应该知足的要求

中文: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.
相关文章
相关标签/搜索