log

package
v0.0.0-...-485d38d Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Forwards all logging to Fluentd

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fluentf

func Fluentf(errorLevel string, format string, a ...interface{})

Log a formatted string to Fluent. It is suggested that 'tag' be set to the name of the source file. eg "log.go" Otherwise, 'tag' can be set to an empty string if the default tag of 'enu.$ENV.$HOSTNAME' is sufficient Use this function whenever doing general logging which doesn't require the context to be logged If the environment variable ENV=dev then this function will also log to stdout

func FluentfContext

func FluentfContext(errorLevel string, context context.Context, format string, a ...interface{})

Log a formatted string with a corresponding context to Fluent. The values from the context are copied to a local struct If the environment variable ENV=dev then this function will also log to stdout

func FluentfObject

func FluentfObject(errorLevel string, objectToLog interface{}, format string, a ...interface{})

Log a formatted string with a corresponding context to Fluent. The values from the context are copied to a local struct If the environment variable ENV=dev then this function will also log to stdout

func Init

func Init()

Initialises global variables and database connection for all handlers

func InitWithConfigPath

func InitWithConfigPath(configFilePath string)

func Printf

func Printf(format string, a ...interface{})

Compatibility function with existing logger. Writes a copy of the string to format to stdout but also sends a copy to Fluent Uses a default tag of 'enu.$ENV.$HOSTNAME' Note: If unable to forward to Fluent, this function will NOT raise errors with respect to Fluent

func Println

func Println(a string)

Compatibility function with existing logger. Writes a copy of the string to format to stdout but also sends a copy to Fluent Uses a default tag of 'enu.$ENV.$HOSTNAME' Note: If unable to forward to Fluent, this function will NOT raise errors with respect to Fluent

Types

This section is empty.

Jump to

Keyboard shortcuts

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