Skip to content

Commit

Permalink
fix: renamed log_sql_vars to log_vars
Browse files Browse the repository at this point in the history
  • Loading branch information
dosco committed May 22, 2024
1 parent 81c06b9 commit dd3793f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ type Config struct {
Debug bool `jsonschema:"title=Debug,default=false"`

// Log SQL Query variable values
LogSQLVars bool `mapstructure:"log_sql_vars" json:"log_sql_vars" yaml:"log_sql_vars" jsonschema:"title=Log SQL Variables,default=false"`
LogVars bool `mapstructure:"log_vars" json:"log_vars" yaml:"log_vars" jsonschema:"title=Log Variables,default=false"`

// Database polling duration (in seconds) used by subscriptions to
// query for updates.
Expand Down
4 changes: 2 additions & 2 deletions serv/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,13 +348,13 @@ func (s *service) reqLog(res *core.Result, rc core.ReqConfig, resTimeMs int64, e
fields = append(fields, zap.String("namespace", ns))
}

if res.Vars != nil && s.conf.Core.LogSQLVars {
if res.Vars != nil && s.conf.Core.LogVars {
var vars map[string]interface{}
err := json.Unmarshal(res.Vars, &vars)
if err != nil {
s.log.Error("failed to unmarshal sql vars", zap.Error(err))
}
fields = append(fields, zap.Any("sqlVars", vars))
fields = append(fields, zap.Any("vars", vars))
}

if sql != "" && s.logLevel >= logLevelDebug {
Expand Down

0 comments on commit dd3793f

Please sign in to comment.