1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-05 19:27:05 +00:00

accesslog: improvements and new features

relative to: #1601 and #1624
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-09-13 02:56:22 +03:00
parent 7d5789c3de
commit 4845b77177
16 changed files with 612 additions and 261 deletions

View File

@@ -1,5 +1,7 @@
Timestamp,Latency,Code,Method,Path,IP,Req Values,In,Out,Request,Response
1599900695933,0s,200,GET,/,::1,sleep=35ms,575,81,,Index
1599900696207,0s,404,GET,/notfound,::1,,572,92,,Not Found
1599900696693,0s,200,GET,/,::1,,564,81,,Index
1599900697988,1s,200,GET,/,::1,sleep=1s,573,81,,Index
1599952696740,0s,200,GET,/,::1,,0,5,,Index
1599952696774,0s,404,GET,/favicon.ico,::1,,0,9,,Not Found
1599952697996,0s,200,GET,/,::1,,0,5,,Index
1599952698130,0s,200,GET,/,::1,,0,5,,Index
1599952698261,0s,200,GET,/,::1,,0,5,,Index
1599952741189,1.01113s,200,GET,/,::1,sleep=1s,0,5,,Index

View File

@@ -10,11 +10,10 @@ import (
func main() {
app := iris.New()
ac := accesslog.File("access_log.csv")
ac.ResponseBody = true
ac.SetFormatter(&accesslog.CSV{
AutoFlush: true,
Header: true,
Header: true,
// DateScript: "FROM_UNIX",
LatencyRound: time.Second,
})
app.UseRouter(ac.Handler)