httplog

package
v0.0.0-...-278bb9c Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package httplog provides a log for logrus, which enables log lines to be sent using http requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLogHandler

func CreateLogHandler(logger *log.Logger) http.HandlerFunc

CreateLogHandler creates a new log handler. It takes a logger as parameter, and returns a HandlerFunc which can be used with the go http framework.

Types

type Hook

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

Hook is the actual struct which can be given to logrus.

func NewLogHook

func NewLogHook(url, origin string) *Hook

NewLogHook Creates a new http log hook, to be given to logrus.

func (Hook) Fire

func (h Hook) Fire(entry *log.Entry) error

Fire implementation for the http log hook.

func (Hook) Levels

func (h Hook) Levels() []log.Level

Levels implementation for the http log hook.

Jump to

Keyboard shortcuts

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