1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 18:07:01 +00:00

add an accesslog simple example

This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-09-12 13:45:00 +03:00
parent 2b342a5122
commit 7d5789c3de
4 changed files with 45 additions and 5 deletions

View File

@@ -15,6 +15,7 @@ func main() {
app := iris.New()
ac := accesslog.File("./access.log").AddOutput(app.Logger().Printer)
defer ac.Close()
// 1. Register a field.
ac.AddFields(func(ctx iris.Context, fields *accesslog.Fields) {