logging: Implement net writer (#2884)

* Implement UDP writer

* Implement Net Writer

* Utilize Caddy's address parsing functions

* A couple little fixes (see #2884)
This commit is contained in:
Abdelmalek Ihdene
2019-12-15 14:58:01 -05:00
committed by Matt Holt
parent 6ea121ddf8
commit c3bcd967bd
4 changed files with 93 additions and 4 deletions

View File

@ -711,6 +711,12 @@ traverseLoop:
return fmt.Errorf("unrecognized method %s", method)
}
} else {
// if we are "PUTting" a new resource, the key(s) in its path
// might not exist yet; that's OK but we need to make them as
// we go, while we still have a pointer from the level above
if v[part] == nil && method == http.MethodPut {
v[part] = make(map[string]interface{})
}
ptr = v[part]
}