Skip to content

Commit

Permalink
Merge pull request projectdiscovery#64 from bridge-four/dev
Browse files Browse the repository at this point in the history
Add timestamps
  • Loading branch information
ehsandeep committed Jan 14, 2022
2 parents 363d5e9 + c8430a9 commit 54119c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/httpserver/loglayer.go
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"net/http"
"net/http/httputil"

"time"
"github.com/projectdiscovery/gologger"
)

Expand Down Expand Up @@ -32,9 +32,9 @@ func (t *HTTPServer) loglayer(handler http.Handler) http.Handler {
if EnableVerbose {
headers := new(bytes.Buffer)
lrw.Header().Write(headers) //nolint
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))
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))
} else {
gologger.Print().Msgf("%s \"%s %s %s\" %d %d", r.RemoteAddr, r.Method, r.URL, r.Proto, lrw.statusCode, lrw.Size)
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)
}
})
}
Expand Down

0 comments on commit 54119c6

Please sign in to comment.