logging

package module
v0.0.0-...-df7d857 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: MIT Imports: 11 Imported by: 0

README

logging

Go Report Card codecov CircleCI

Log constructor and Access Logging Middleware Handler for Go.

Documentation

Overview

Package logging provids a sensiblely configured logger and an htttp access logging Handler.

Index

Constants

View Source
const (
	// TimeFormat is the time format for logging.
	TimeFormat = time.RFC3339Nano
)

Variables

This section is empty.

Functions

func NewAccessLogger

func NewAccessLogger(handler http.Handler, logger zerolog.Logger) http.Handler

NewAccessLogger returns a constructed AccessLogger pointer.

func NewLogger

func NewLogger(app string, verbose bool, out io.Writer) zerolog.Logger

NewLogger returns a constructed logger.

Types

type AccessLogger

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

AccessLogger writes an NCSA combined-ish log record. Note this skips the rfc931 ident field.

func (*AccessLogger) ServeHTTP

func (al *AccessLogger) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP makes our type a http.HandlerFunc.

Jump to

Keyboard shortcuts

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