gelf

package
v0.0.0-...-ea2badb Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2015 License: MIT Imports: 9 Imported by: 2

README

gelf

This formatter outputs GELF v1.1

This is used in our production system to output GELF formatted logs. The features built into it (such as logging http.Request), were built because that's what we needed. If you have different requirements, feel free to copy the code into your repository and modify it.

I may make the gelf package more generic so others can do what they want. If you have an idea of how to do this with a good API, let me know.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extra

type Extra map[string]interface{}
Extra is a type you wrap around data to be added

as extra fields to JSON.

type GELFFormatter

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

GLEFFormatter provides a formatter that outputs GELF v1.1 data. It will also encode extra information such as an http.Request.

func New

func New() *GELFFormatter

func NewGELFFormatter

func NewGELFFormatter() *GELFFormatter

NewGELFFormatter returns a new GELFFormatter

func (*GELFFormatter) Format

func (f *GELFFormatter) Format(context log.LogContext) []byte

Format formats a LogContext into the GELF format.

func (*GELFFormatter) ShouldRuntimeCaller

func (f *GELFFormatter) ShouldRuntimeCaller() bool

ShouldRuntimeCaller will always return true.

Jump to

Keyboard shortcuts

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