Skip to content

Commit

Permalink
session: adjust session log (pingcap#10088)
Browse files Browse the repository at this point in the history
Signed-off-by: Keyi Xie <[email protected]>
  • Loading branch information
xiekeyi98 authored Apr 10, 2019
1 parent f723f0b commit b1148e6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -1676,14 +1676,14 @@ func logStmt(node ast.StmtNode, vars *variable.SessionVars) {
user := vars.User
schemaVersion := vars.TxnCtx.SchemaVersion
if ss, ok := node.(ast.SensitiveStmtNode); ok {
logutil.Logger(context.Background()).Info("[CRUCIAL OPERATION]",
zap.Uint64("con", vars.ConnectionID),
logutil.Logger(context.Background()).Info("CRUCIAL OPERATION",
zap.Uint64("conn", vars.ConnectionID),
zap.Int64("schemaVersion", schemaVersion),
zap.String("secure text", ss.SecureText()),
zap.Stringer("user", user))
} else {
logutil.Logger(context.Background()).Info("[CRUCIAL OPERATION]",
zap.Uint64("con", vars.ConnectionID),
logutil.Logger(context.Background()).Info("CRUCIAL OPERATION",
zap.Uint64("conn", vars.ConnectionID),
zap.Int64("schemaVersion", schemaVersion),
zap.String("cur_db", vars.CurrentDB),
zap.String("sql", stmt.Text()),
Expand All @@ -1697,8 +1697,8 @@ func logStmt(node ast.StmtNode, vars *variable.SessionVars) {
func logQuery(query string, vars *variable.SessionVars) {
if atomic.LoadUint32(&variable.ProcessGeneralLog) != 0 && !vars.InRestrictedSQL {
query = executor.QueryReplacer.Replace(query)
logutil.Logger(context.Background()).Info("[GENERAL_LOG]",
zap.Uint64("con", vars.ConnectionID),
logutil.Logger(context.Background()).Info("GENERAL_LOG",
zap.Uint64("conn", vars.ConnectionID),
zap.Stringer("user", vars.User),
zap.Int64("schemaVersion", vars.TxnCtx.SchemaVersion),
zap.Uint64("txnStartTS", vars.TxnCtx.StartTS),
Expand Down

0 comments on commit b1148e6

Please sign in to comment.