mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-22 17:19:06 +01:00
add time field to json access log
This commit is contained in:
@@ -20,6 +20,7 @@ type (
|
||||
CommonFormatter
|
||||
}
|
||||
JSONLogEntry struct {
|
||||
Time string `json:"time"`
|
||||
IP string `json:"ip"`
|
||||
Method string `json:"method"`
|
||||
Scheme string `json:"scheme"`
|
||||
@@ -101,6 +102,7 @@ func (f JSONFormatter) Format(line *bytes.Buffer, req *http.Request, res *http.R
|
||||
cookies := f.cfg.Cookies.ProcessCookies(req.Cookies())
|
||||
|
||||
entry := JSONLogEntry{
|
||||
Time: timeNow(),
|
||||
IP: clientIP(req),
|
||||
Method: req.Method,
|
||||
Scheme: scheme(req),
|
||||
|
||||
Reference in New Issue
Block a user