blob: 202b186431381ac16c6156ba97c62f37f54170f0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
package log
import (
"net/http"
"github.com/xlgmokha/x/pkg/mapper"
)
func init() {
mapper.Register[*http.Request, Fields](func(r *http.Request) Fields {
return Fields{
"host": r.URL.Host,
"method": r.Method,
"path": r.URL.Path,
"remote_host": r.RemoteAddr,
}
})
}
|