❯ go run ./main.go
{"level":"info","time":"2022-01-10T08:43:25-03:00","message":"Running on :3000"}
{"level":"info","service":"http","httpRequest":{"proto":"HTTP/1.1","remoteIP":"[::1]:59744","requestID":"dell-rrsp/SaPMv1pZaJ-000001","requestMethod":"GET","requestPath":"/","requestURL":"http://localhost:3000/"},"httpRequest":{"header":{"accept":"*/*","accept-encoding":"gzip, deflate, br","connection":"keep-alive","user-agent":"xh/0.14.1"},"proto":"HTTP/1.1","remoteIP":"[::1]:59744","requestID":"dell-rrsp/SaPMv1pZaJ-000001","requestMethod":"GET","requestPath":"/","requestURL":"http://localhost:3000/","scheme":"http"},"time":"2022-01-10T08:43:28-03:00","message":"Request: GET /"}
{"level":"info","service":"http","httpRequest":{"proto":"HTTP/1.1","remoteIP":"[::1]:59744","requestID":"dell-rrsp/SaPMv1pZaJ-000001","requestMethod":"GET","requestPath":"/","requestURL":"http://localhost:3000/"},"httpResponse":{"bytes":2,"elapsed":0.011784,"status":200},"time":"2022-01-10T08:43:28-03:00","message":"Response: 200 OK"}
module bug
go 1.17
require (
github.com/go-chi/chi/v5 v5.0.7
github.com/go-chi/httplog v0.2.1
github.com/rs/zerolog v1.26.1
)
Code:
Log when I request
GET /usingxh :3000:The
go.modfile