mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 15:30:36 +01:00
minor
This commit is contained in:
parent
d17a888dc1
commit
fb7627256a
|
@ -156,12 +156,12 @@ func sessionHandler(ctx iris.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func fieldsHandler(ctx iris.Context) {
|
func fieldsHandler(ctx iris.Context) {
|
||||||
// simulate a heavy job...
|
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
|
// simulate a heavy job...
|
||||||
time.Sleep(2 * time.Second)
|
time.Sleep(2 * time.Second)
|
||||||
end := time.Since(start)
|
end := time.Since(start)
|
||||||
// Get the current fields instance and use
|
// Get the current fields instance
|
||||||
// them to it custom log values.
|
// and use it to set custom log values.
|
||||||
logFields := accesslog.GetFields(ctx)
|
logFields := accesslog.GetFields(ctx)
|
||||||
logFields.Set("job_latency", end.Round(time.Second))
|
logFields.Set("job_latency", end.Round(time.Second))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user