You've already forked prometheus-fail2ban-exporter
feat: improve logging on startup
Update the exporter logging on startup to include the exporter version, the path to the fail2ban socket, and whether basic-auth is enabled or not. Fix code printing error messages on invalid CLI parameters to correct line breaks and correctly print the "usage" information.
This commit is contained in:
@ -55,8 +55,8 @@ func main() {
|
||||
printAppVersion()
|
||||
} else {
|
||||
addr := fmt.Sprintf("%s:%d", appSettings.MetricsAddress, appSettings.MetricsPort)
|
||||
|
||||
log.Printf("starting fail2ban exporter at %s", addr)
|
||||
log.Printf("fail2ban exporter version %s", version)
|
||||
log.Printf("starting server at %s", addr)
|
||||
|
||||
f2bCollector := f2b.NewExporter(appSettings, version)
|
||||
prometheus.MustRegister(f2bCollector)
|
||||
@ -72,6 +72,9 @@ func main() {
|
||||
appSettings.BasicAuthProvider,
|
||||
))
|
||||
log.Printf("metrics available at '%s'", metricsPath)
|
||||
if appSettings.BasicAuthProvider.Enabled() {
|
||||
log.Printf("basic auth enabled")
|
||||
}
|
||||
|
||||
svrErr := make(chan error)
|
||||
go func() {
|
||||
|
Reference in New Issue
Block a user