Pull request: 2954 wrong logs
Merge in DNS/adguard-home from 2954-wrong-logs to master Closes #2954. Squashed commit of the following: commit 94c77a4dfcadbbf4f44ba4c6b30d4d00d98e659b Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 19:15:18 2021 +0300 all: log changes commit b5095715e7ba7fd99a03869a97cf7291daaa4fc4 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 19:09:46 2021 +0300 go.mod: upd golibs commit 70ec262f7bf177e4f9c7a9ee345ec2694e27a549 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Apr 15 17:57:25 2021 +0300 home: fix config logging commit f45c407b400431ac0501b915a3070c6071112fee Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Apr 14 15:00:55 2021 +0300 home: fix rdns logging
This commit is contained in:
@@ -2,6 +2,7 @@ package home
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"os"
|
||||
@@ -260,8 +261,7 @@ func readConfigFile() ([]byte, error) {
|
||||
configFile := config.getConfigFilename()
|
||||
d, err := ioutil.ReadFile(configFile)
|
||||
if err != nil {
|
||||
log.Error("Couldn't read config file %s: %s", configFile, err)
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("couldn't read config file %s: %w", configFile, err)
|
||||
}
|
||||
return d, nil
|
||||
}
|
||||
|
||||
@@ -163,12 +163,14 @@ func setupContext(args options) {
|
||||
|
||||
err = parseConfig()
|
||||
if err != nil {
|
||||
log.Error("Failed to parse configuration, exiting")
|
||||
log.Error("parsing configuration file: %s", err)
|
||||
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if args.checkConfig {
|
||||
log.Info("Configuration file is OK")
|
||||
log.Info("configuration file is ok")
|
||||
|
||||
os.Exit(0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ func (r *RDNS) workerLoop() {
|
||||
for ip := range r.ipCh {
|
||||
host, err := r.exchanger.Exchange(ip)
|
||||
if err != nil {
|
||||
log.Error("rdns: resolving %q: %s", ip, err)
|
||||
log.Debug("rdns: resolving %q: %s", ip, err)
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ func (web *Web) Start() {
|
||||
hostStr := web.conf.BindHost.String()
|
||||
// we need to have new instance, because after Shutdown() the Server is not usable
|
||||
web.httpServer = &http.Server{
|
||||
ErrorLog: log.StdLog("web: http", log.DEBUG),
|
||||
ErrorLog: log.StdLog("web: plain", log.DEBUG),
|
||||
Addr: net.JoinHostPort(hostStr, strconv.Itoa(web.conf.BindPort)),
|
||||
Handler: withMiddlewares(Context.mux, limitRequestBody),
|
||||
ReadTimeout: web.conf.ReadTimeout,
|
||||
@@ -184,7 +184,7 @@ func (web *Web) Start() {
|
||||
|
||||
if web.conf.BetaBindPort != 0 {
|
||||
web.httpServerBeta = &http.Server{
|
||||
ErrorLog: log.StdLog("web: http", log.DEBUG),
|
||||
ErrorLog: log.StdLog("web: plain", log.DEBUG),
|
||||
Addr: net.JoinHostPort(hostStr, strconv.Itoa(web.conf.BetaBindPort)),
|
||||
Handler: withMiddlewares(Context.mux, limitRequestBody, web.wrapIndexBeta),
|
||||
ReadTimeout: web.conf.ReadTimeout,
|
||||
|
||||
Reference in New Issue
Block a user