a5glogs

package
v0.0.0-...-35a760b Latest Latest
Warning

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

Go to latest
Published: May 8, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package a5glogs by chi example <https://github.com/pressly/chi/blob/master/_examples/logging/main.go>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirectoryAndLogName

func DirectoryAndLogName(logPath string, fileExcludeRegexp *regexp.Regexp) (
	string, string, error)

func LogEntrySetField

func LogEntrySetField(r *http.Request, key string, value fmt.Stringer)

func LogEntrySetFields

func LogEntrySetFields(r *http.Request, a ...a5gfields.Field)

func NewChiLogger

func NewChiLogger(l Logger) func(next http.Handler) http.Handler

func NewMGOOutputer

func NewMGOOutputer(l Logger) (*mgoOutputer, error)

func PartitionedPathByUserID

func PartitionedPathByUserID(i int64) (string, error)

PartitionedPathByUserID produces path "000/000/001" for id 1. You may use this to generate path like: "/var/log/appname/123/456/789/123456789/your.log". <https://gist.github.com/xlab/6e204ef96b4433a697b3>

Types

type DummyHealth

type DummyHealth struct{ Logger Logger }

func NewDummyHealth

func NewDummyHealth(l Logger) (*DummyHealth, error)

func (*DummyHealth) Event

func (l *DummyHealth) Event(eventName string)

func (*DummyHealth) EventErr

func (l *DummyHealth) EventErr(eventName string, err error) error

func (*DummyHealth) EventErrKv

func (l *DummyHealth) EventErrKv(
	eventName string, err error, m map[string]string) error

func (*DummyHealth) EventKv

func (l *DummyHealth) EventKv(eventName string, m map[string]string)

func (*DummyHealth) Timing

func (l *DummyHealth) Timing(eventName string, nanoSeconds int64)

func (*DummyHealth) TimingKv

func (l *DummyHealth) TimingKv(
	eventName string, nanoSeconds int64, m map[string]string)

type Logger

type Logger interface {
	With(...a5gfields.Field) Logger
	Debug(string, ...a5gfields.Field)
	Info(string, ...a5gfields.Field)
	Warn(string, ...a5gfields.Field)
	Error(string, ...a5gfields.Field)
	Panic(string, ...a5gfields.Field)
	Fatal(string, ...a5gfields.Field)
}

func GetLogEntry

func GetLogEntry(r *http.Request) Logger

func NewLogrusWrapper

func NewLogrusWrapper(l *logrus.Logger) Logger

type MGOOutputer

type MGOOutputer interface {
	Output(int, string) error
}

Jump to

Keyboard shortcuts

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