logmonitor

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL