logging

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFormatter

func BuildFormatter(key string) func(data loglight.LogEntry) string

func DebugFormatter

func DebugFormatter(logEntry loglight.LogEntry) string

func Initialise

func Initialise(logger *loglight.Logger)

func LogDebug

func LogDebug(logType LogEventType, request *http.Request, additional interface{})

func LogError

func LogError(logType LogEventType, request *http.Request, additional interface{})

func LogInfo

func LogInfo(logType LogEventType, request *http.Request, additional interface{})

Types

type LogEvent

type LogEvent struct {
	TimeUtc     time.Time
	ServiceKey  string
	Title       LogEventType
	Additional  interface{}
	RequestKey  string
	HostAddress string
}

type LogEventType

type LogEventType string
const (
	GetHealthcheckStart LogEventType = "Get Healthcheck - Start"
	GetHealthcheckEnd   LogEventType = "Get Healthcheck - End"
	PostEmailStart      LogEventType = "Post Email - Start"
	PostEmailEnd        LogEventType = "Post Email - End"
	PostEmailDebug      LogEventType = "Post Email - Debug"
	PostEmailError      LogEventType = "Post Email - Error"
	Panic               LogEventType = "Panic"
	Api                 LogEventType = "Api"
	Unauthorised        LogEventType = "Unauthorised Request"
)

type RequestKey

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

func (*RequestKey) Handler

func (c *RequestKey) Handler(h http.Handler) http.Handler

Handler apply the CORS specification on the request, and add relevant CORS headers as necessary.

func (*RequestKey) ServeHTTP

func (key *RequestKey) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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