feat: more logging info + loglevel
This commit is contained in:
parent
0a1a496ba1
commit
1247847e9a
@ -18,6 +18,7 @@ type Config struct {
|
||||
DdUsers map[string]map[string]string `json:"dd_users"`
|
||||
DnsTTL int `json:"dns_ttl"`
|
||||
DnsServer string `json:"dns_server"`
|
||||
Loglevel string `json:"loglevel"`
|
||||
}
|
||||
|
||||
var config Config
|
||||
|
@ -22,6 +22,10 @@ func handleDynamicUpdate(w http.ResponseWriter, r *http.Request) {
|
||||
up := r.URL.Query()
|
||||
ip := r.Header.Get("X-FORWARDED-FOR")
|
||||
|
||||
if config.Loglevel == "verbose" {
|
||||
log.Println(up, ip)
|
||||
}
|
||||
|
||||
if len(ip) < 1 {
|
||||
ip = strings.Split(r.RemoteAddr, ":")[0]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user