mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 10:27:06 +00:00
more improvements to the new accesslog middleware: ability to add custom fields and change the order on the printable result
relative to: https://github.com/kataras/iris/issues/1601
This commit is contained in:
@@ -35,6 +35,12 @@ func main() {
|
||||
|
||||
Change format (after output was set):
|
||||
ac.SetFormatter(&accesslog.JSON{Indent: " "})
|
||||
|
||||
Change the format and customize the order
|
||||
with the Template format:
|
||||
ac.SetFormatter(&accesslog.Template{
|
||||
Text: "{{.Now.Format .TimeFormat}}|{{.Latency}}|{{.Method}}|{{.Path}}|{{.RequestValuesLine}}|{{.Code}}|{{.Request}}|{{.Response}}|\n",
|
||||
})
|
||||
*/
|
||||
|
||||
defer ac.Close()
|
||||
|
||||
Reference in New Issue
Block a user