mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-11 03:33:53 +08:00
发布v2.15.7版本,更新内容请查看:https://github.com/bufanyun/hotgo/tree/v2.0/docs/guide-zh-CN/addon-version-upgrade.md
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user