Skip to content

Commit c8430a9

Browse files
committed
add timestamps
1 parent 363d5e9 commit c8430a9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/httpserver/loglayer.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"bytes"
55
"net/http"
66
"net/http/httputil"
7-
7+
"time"
88
"github.com/projectdiscovery/gologger"
99
)
1010

@@ -32,9 +32,9 @@ func (t *HTTPServer) loglayer(handler http.Handler) http.Handler {
3232
if EnableVerbose {
3333
headers := new(bytes.Buffer)
3434
lrw.Header().Write(headers) //nolint
35-
gologger.Print().Msgf("\nRemote Address: %s\n%s\n%s %d %s\n%s\n%s\n", r.RemoteAddr, string(fullRequest), r.Proto, lrw.statusCode, http.StatusText(lrw.statusCode), headers.String(), string(lrw.Data))
35+
gologger.Print().Msgf("\n[%s]\nRemote Address: %s\n%s\n%s %d %s\n%s\n%s\n", time.Now().Format("2006-01-02 15:04:05"), r.RemoteAddr, string(fullRequest), r.Proto, lrw.statusCode, http.StatusText(lrw.statusCode), headers.String(), string(lrw.Data))
3636
} else {
37-
gologger.Print().Msgf("%s \"%s %s %s\" %d %d", r.RemoteAddr, r.Method, r.URL, r.Proto, lrw.statusCode, lrw.Size)
37+
gologger.Print().Msgf("[%s] %s \"%s %s %s\" %d %d", time.Now().Format("2006-01-02 15:04:05"), r.RemoteAddr, r.Method, r.URL, r.Proto, lrw.statusCode, lrw.Size)
3838
}
3939
})
4040
}

0 commit comments

Comments
 (0)