log

package module
v0.0.0-...-3606b75 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2018 License: MIT Imports: 8 Imported by: 1

README

Logger

A logger middleware for Gin

GoDoc

Usage

import "github.com/qor/log"

func main() {
  router := gin.New()
  router.Use(log.Logger("application.log", 30)) // save logs into application.log, max days is 30
}

License

Released under the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logger

func Logger(fileName string, maxdays int) gin.HandlerFunc

Logger is a middleware that will write the logs to gin.DefaultWriter By default gin.DefaultWriter = os.Stdout

func LoggerWithHide

func LoggerWithHide(hideValues []string) gin.HandlerFunc

LoggerWithHide is a middleware that will hide the values of the given headers when logging Must specify all headers, password is not default here Default writer is used

func LoggerWithWriter

func LoggerWithWriter(out io.Writer) gin.HandlerFunc

LoggerWithWriter is a middleware with the specified writer buffer. Example: os.Stdout, a file opened in write mode, a socket...

Types

This section is empty.

Jump to

Keyboard shortcuts

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