douzhu5900
douzhu5900
2017-11-14 20:42

Go运行时日志记录详细程度更改

已采纳

I need to change logging verbosity/level while Golang application is running, without restarting

I came from PHP where there are several logging frameworks supporting DB-based configuration change on run-time

What's the most standard/canonical way to achieve this kind of functionality in Go?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • doujie7497 doujie7497 4年前

    I would recommend using a library like https://github.com/sirupsen/logrus that has built in logging levels. Also can do structured logging

    点赞 评论 复制链接分享

为你推荐