Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var LogRequest = true
LogRequest activate the request body logging
View Source
var LogResponse = true
LogResponse activate the response body logging
View Source
var RespBodyExludedRoutes = []string{"css", "font", "js", "assets", "icons", "img", "images", "script", "favicon.ico", "swagger"}
RespBodyExludedRoutes are the routes for which we don't want to log the response body
View Source
var TimeFormat = "2006-01-02T15:04:05-0700"
TimeFormat is the logs desired time format
Functions ¶
func ExcludeRespBodyLog ¶
ExcludeRespBodyLog excludes some standard paths response body from being logged
func Tee ¶
func Tee(httpReqBody *io.ReadCloser) []byte
Tee provides a copy of the request body to be logged
Types ¶
type RespBodyLogger ¶
type RespBodyLogger struct { gin.ResponseWriter // contains filtered or unexported fields }
RespBodyLogger contains the body of the response for logging purpose
Click to show internal directories.
Click to hide internal directories.