mirror of https://github.com/toorop/gin-logrus.git
add hostname on msg
This commit is contained in:
parent
b1978c0b59
commit
da123c7cdc
|
@ -41,6 +41,7 @@ func Logger(log *logrus.Logger) gin.HandlerFunc {
|
||||||
}
|
}
|
||||||
|
|
||||||
entry := logrus.NewEntry(log).WithFields(logrus.Fields{
|
entry := logrus.NewEntry(log).WithFields(logrus.Fields{
|
||||||
|
"hostname": hostname,
|
||||||
"statusCode": statusCode,
|
"statusCode": statusCode,
|
||||||
"latency": latency, // time to process
|
"latency": latency, // time to process
|
||||||
"clientIP": clientIP,
|
"clientIP": clientIP,
|
||||||
|
|
Loading…
Reference in New Issue