Skip to content

Commit c54d9e8

Browse files
committed
Added user-agent to logger middleware
Signed-off-by: Vishal Rana <vr@labstack.com>
1 parent b37628b commit c54d9e8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

middleware/logger.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ var (
6868
// DefaultLoggerConfig is the default Logger middleware config.
6969
DefaultLoggerConfig = LoggerConfig{
7070
Skipper: DefaultSkipper,
71-
Format: `{"time":"${time_rfc3339_nano}","id":"${id}","remote_ip":"${remote_ip}","host":"${host}",` +
72-
`"method":"${method}","uri":"${uri}","status":${status},"error":"${error}","latency":${latency},` +
73-
`"latency_human":"${latency_human}","bytes_in":${bytes_in},` +
74-
`"bytes_out":${bytes_out}}` + "\n",
71+
Format: `{"time":"${time_rfc3339_nano}","id":"${id}","remote_ip":"${remote_ip}",` +
72+
`"host":"${host}","method":"${method}","uri":"${uri}","user_agent":"${user_agent}",` +
73+
`"status":${status},"error":"${error}","latency":${latency}","latency_human":"${latency_human}"` +
74+
`,"bytes_in":${bytes_in},"bytes_out":${bytes_out}}` + "\n",
7575
CustomTimeFormat: "2006-01-02 15:04:05.00000",
7676
Output: os.Stdout,
7777
colorer: color.New(),

0 commit comments

Comments
 (0)