mirror of
https://github.com/kataras/iris.git
synced 2025-12-20 03:17:04 +00:00
minor (see previous commit)
This commit is contained in:
@@ -41,6 +41,16 @@ func main() {
|
||||
ac.SetFormatter(&accesslog.Template{
|
||||
Text: "{{.Now.Format .TimeFormat}}|{{.Latency}}|{{.Method}}|{{.Path}}|{{.RequestValuesLine}}|{{.Code}}|{{.Request}}|{{.Response}}|\n",
|
||||
})
|
||||
|
||||
Set custom request fields:
|
||||
ac.AddField(func(ctx iris.Context) (string, interface{}) {
|
||||
v := ctx.RemoteAddr()
|
||||
if v == "" {
|
||||
return "", nil
|
||||
}
|
||||
// the log entry name and its value.
|
||||
return "IP", v
|
||||
})
|
||||
*/
|
||||
|
||||
defer ac.Close()
|
||||
|
||||
Reference in New Issue
Block a user