Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set clampLevel to 3 for debug logs #233

Merged
merged 1 commit into from
Apr 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/sql_exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const (
envConfigFile = "SQLEXPORTER_CONFIG"
envDebug = "SQLEXPORTER_DEBUG"
httpReadHeaderTimeout = time.Duration(time.Second * 60)
debugMaxLevel = 3
)

var (
Expand Down Expand Up @@ -59,6 +60,7 @@ func main() {
// Thus we need to pass it our go-kit logger object.
logger := promlog.New(promlogConfig)
klog.SetLogger(logger)
klog.ClampLevel(debugMaxLevel)

// Override --alsologtostderr default value.
if alsoLogToStderr := flag.Lookup("alsologtostderr"); alsoLogToStderr != nil {
Expand Down