@@ -92,17 +92,17 @@ func TestLoggerTemplate(t *testing.T) {
9292 e .Use (LoggerWithConfig (LoggerConfig {
9393 Format : `{"time":"${time_rfc3339_nano}","id":"${id}","remote_ip":"${remote_ip}","host":"${host}","user_agent":"${user_agent}",` +
9494 `"method":"${method}","uri":"${uri}","status":${status}, "latency":${latency},` +
95- `"latency_human":"${latency_human}","bytes_in":${bytes_in}, "path":"${path}", "referer":"${referer}",` +
95+ `"latency_human":"${latency_human}","bytes_in":${bytes_in}, "path":"${path}", "route":"${route}", " referer":"${referer}",` +
9696 `"bytes_out":${bytes_out},"ch":"${header:X-Custom-Header}", "protocol":"${protocol}"` +
9797 `"us":"${query:username}", "cf":"${form:username}", "session":"${cookie:session}"}` + "\n " ,
9898 Output : buf ,
9999 }))
100100
101- e .GET ("/" , func (c echo.Context ) error {
101+ e .GET ("/users/:id " , func (c echo.Context ) error {
102102 return c .String (http .StatusOK , "Header Logged" )
103103 })
104104
105- req := httptest .NewRequest (http .MethodGet , "/?username=apagano-param&password=secret" , nil )
105+ req := httptest .NewRequest (http .MethodGet , "/users/1 ?username=apagano-param&password=secret" , nil )
106106 req .RequestURI = "/"
107107 req .Header .Add (echo .HeaderXRealIP , "127.0.0.1" )
108108 req .Header .Add ("Referer" , "google.com" )
@@ -127,7 +127,8 @@ func TestLoggerTemplate(t *testing.T) {
127127 "hexvalue" : false ,
128128 "GET" : true ,
129129 "127.0.0.1" : true ,
130- "\" path\" :\" /\" " : true ,
130+ "\" path\" :\" /users/1\" " : true ,
131+ "\" route\" :\" /users/:id\" " : true ,
131132 "\" uri\" :\" /\" " : true ,
132133 "\" status\" :200" : true ,
133134 "\" bytes_in\" :0" : true ,
0 commit comments