INNER CODE UNIT · Go
func
feiyu563/PrometheusAlert · main.go:127
func (f *CustomAccessLogFilter) Filter(ctx *beecontext.Context) bool {
return ctx.Request.URL.Path == "/health"
}
func main() {
orm.Debug = true
logtype := beego.AppConfig.String("logtype")
if logtype == "console" {
logs.SetLogger(logtype)
} else if logtype == "file" {
logpath := beego.AppConfig.String("logpath")
logs.SetLogger(logtype, `{"filename":"`+logpath+`"}`)
}
// 定时删除日志
RecordLive, _ := beego.AppConfig.Int("RecordLive")
if RecordLive == 1 {
RecordLiveDay, _ := beego.AppConfig.Int("RecordLiveDay")