accesslog

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: MIT Imports: 3 Imported by: 0

README

Access log package

This is a package for access logging in a web app.

Usage

Here is an example of how to use this package. Init logger in main to be used everywhere in the app.

// In main function
appName := "todo"
accesslog.SetAppName(appName)

// Used elsewhere in the app
duration := 100
status := 200
accesslog.Info(duration, status, "/path", "GET")

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Info

func Info(durationMs int, status int, requestPath string, requestMethod string)

func SetAppName

func SetAppName(appName string)

Types

type AccessLogger

type AccessLogger struct {
	// contains filtered or unexported fields
}

func GetLogger

func GetLogger() *AccessLogger

func NewAccessLogger

func NewAccessLogger(appName string) *AccessLogger

func (*AccessLogger) Info

func (al *AccessLogger) Info(durationMs int, status int, requestPath string, requestMethod string)

Jump to

Keyboard shortcuts

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