beego log console
控制台查看
logs.SetLogger("console")
logs.SetLogger(logs.AdapterConsole, `{"level":1,"color":true}`)
输出到文件
logs.SetLogger(logs.AdapterFile,`{"filename":"project.log","level":7,"maxlines":0,"maxsize":0,"daily":true,"maxdays":10,"color":true}`)
输出文件名和行号
logs.EnableFuncCallDepth(true)
异步输出日志 设置缓冲 chan 的大小
logs.Async()
logs.Async(1e3)
同时支持
logs.SetLogger(logs.AdapterFile, `{"filename":"test.log"}`)
es multifile conn ElasticSearch 简聊 slack
本文来自博客园,作者:vx_guanchaoguo0,转载请注明原文链接:https://www.cnblogs.com/guanchaoguo/p/16524349.html