Documentation
¶
Overview ¶
Package logmonitor provides logging utilities for a web application. It includes middleware that can be used with the Gin framework to log incoming HTTP requests and their response status, method, path, and the time taken to process.
Copyright (c) 2023 H0llyW00dzZ
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequestLogger ¶
func RequestLogger() gin.HandlerFunc
RequestLogger returns a gin.HandlerFunc (middleware) that logs the details of HTTP requests. It records the status code, HTTP method, the path of the request, and the duration it took to process the request. This middleware is useful for monitoring and debugging the behavior of web services by providing insights into traffic patterns and potential bottlenecks.
Example usage with the Gin framework:
r := gin.Default() r.Use(logmonitor.RequestLogger()) // other routes and middleware r.Run()
Types ¶
This section is empty.