go-httpclerk: github.com/zendesk/go-httpclerk Index | Files

package httpclerk

import "github.com/zendesk/go-httpclerk"

Index

Package Files

http_logger.go logstash_formatter.go text_formatter.go

type Formatter Uses

type Formatter interface {
    Format(interface{}) (string, error)
}

type HTTPLogger Uses

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

func NewHTTPLogger Uses

func NewHTTPLogger(name string, destination LogDestination, formatter Formatter) (*HTTPLogger, error)

NewHTTPLogger constructor

func (*HTTPLogger) Critical Uses

func (log *HTTPLogger) Critical(res http.ResponseWriter, req *http.Request)

func (*HTTPLogger) Debug Uses

func (log *HTTPLogger) Debug(res http.ResponseWriter, req *http.Request)

func (*HTTPLogger) Error Uses

func (log *HTTPLogger) Error(res http.ResponseWriter, req *http.Request)

func (*HTTPLogger) Info Uses

func (log *HTTPLogger) Info(res http.ResponseWriter, req *http.Request)

func (*HTTPLogger) Warning Uses

func (log *HTTPLogger) Warning(res http.ResponseWriter, req *http.Request)

type LogDestination Uses

type LogDestination interface {
    Debug(data string, args ...interface{})
    Info(data string, args ...interface{})
    Warning(data string, args ...interface{})
    Error(data string, args ...interface{})
    Critical(data string, args ...interface{})
}

Implements similar to http://godoc.org/github.com/op/go-logging#Logger

type LogStashFormatter Uses

type LogStashFormatter struct {
    Source string
    Tags   []string
}

func NewLogStashFormatter Uses

func NewLogStashFormatter(source string, tags []string) (*LogStashFormatter, error)

func (*LogStashFormatter) Format Uses

func (formatter *LogStashFormatter) Format(customFields interface{}) (string, error)

type LogStashJSON Uses

type LogStashJSON struct {
    Source    string      `json:"@source"`
    Fields    interface{} `json:"@fields"`
    Tags      []string    `json:"@tags"`
    Timestamp string      `json:"@timestamp"`
}

type TextFormatter Uses

type TextFormatter struct {
    AppName string
}

func NewTextFormatter Uses

func NewTextFormatter(appName string) (*TextFormatter, error)

func (*TextFormatter) Format Uses

func (f *TextFormatter) Format(customFields interface{}) (string, error)

Package httpclerk imports 7 packages (graph). Updated 2016-09-24. Refresh now. Tools for package owners.