From 7583326d2144e3f8a25b8dfe28e73d16fb52690b Mon Sep 17 00:00:00 2001 From: Vikram Rangnekar Date: Fri, 22 Nov 2019 01:32:09 -0500 Subject: [PATCH] Move sql query logging from info to debug --- serv/config.go | 7 +++---- serv/sqllog.go | 4 +--- tmpl/dev.yml | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/serv/config.go b/serv/config.go index c3f840c..698d25b 100644 --- a/serv/config.go +++ b/serv/config.go @@ -64,10 +64,9 @@ type config struct { User string Password string Schema string - PoolSize int32 `mapstructure:"pool_size"` - MaxRetries int `mapstructure:"max_retries"` - LogLevel string `mapstructure:"log_level"` - SetUserID bool `mapstructure:"set_user_id"` + PoolSize int32 `mapstructure:"pool_size"` + MaxRetries int `mapstructure:"max_retries"` + SetUserID bool `mapstructure:"set_user_id"` Vars map[string]string `mapstructure:"variables"` diff --git a/serv/sqllog.go b/serv/sqllog.go index 3fccbea..f620b51 100644 --- a/serv/sqllog.go +++ b/serv/sqllog.go @@ -28,9 +28,7 @@ func (pl *Logger) Log(ctx context.Context, level pgx.LogLevel, msg string, data zlevel = zerolog.ErrorLevel case pgx.LogLevelWarn: zlevel = zerolog.WarnLevel - case pgx.LogLevelInfo: - zlevel = zerolog.InfoLevel - case pgx.LogLevelDebug: + case pgx.LogLevelDebug, pgx.LogLevelInfo: zlevel = zerolog.DebugLevel default: zlevel = zerolog.DebugLevel diff --git a/tmpl/dev.yml b/tmpl/dev.yml index ba63cd5..0f20b0e 100644 --- a/tmpl/dev.yml +++ b/tmpl/dev.yml @@ -3,7 +3,7 @@ host_port: 0.0.0.0:8080 web_ui: true # debug, info, warn, error, fatal, panic -log_level: "warn" +log_level: "info" # When production mode is 'true' only queries # from the allow list are permitted.