This commit is contained in:
孟帅
2024-07-21 22:21:02 +08:00
parent 7d8330f72f
commit a37d088360
440 changed files with 6303 additions and 3339 deletions

View File

@@ -11,6 +11,7 @@ import (
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/os/gctx"
"github.com/gogf/gf/v2/util/gconv"
"github.com/gogf/gf/v2/util/gmode"
"hotgo/internal/dao"
"hotgo/internal/library/hgorm"
"hotgo/internal/library/hgorm/handler"
@@ -46,6 +47,12 @@ func (s *sSysServeLog) List(ctx context.Context, in *sysin.ServeLogListInp) (lis
mod = mod.Where(dao.SysServeLog.Columns().TraceId, in.TraceId)
}
// 非生产环境,允许关键词查询日志
// 生成环境使用需谨慎,日志量大易产生慢日志
if !gmode.IsProduct() && in.Content != "" {
mod = mod.WhereLike(dao.SysServeLog.Columns().Content, "%"+in.Content+"%")
}
// 查询日志级别
if in.LevelFormat != "" {
mod = mod.WhereLike(dao.SysServeLog.Columns().LevelFormat, in.LevelFormat)