elogger

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: MIT Imports: 4 Imported by: 0

README

elogger

Simple Structured logger

Currently only JSON output format

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServiceName = ""

ServiceName name of service

Functions

func Event

func Event(thelog StructuredLog, level, event, msg string)

Event in json format

func LogNew

func LogNew(level, event, msg string)

LogNew is to log with a new StructuredLog struct

Types

type StructuredLog

type StructuredLog struct {
	Timestamp string `json:"@timestamp,omitempty"`
	Service   string `json:"service,omitempty"`
	Thread    string `json:"thread,omitempty"`
	IP        string `json:"ip,omitempty"`
	Env       string `json:"env,omitempty"`
	Server    string `json:"server,omitempty"`

	Level        string      `json:"level,omitempty"`
	Event        string      `json:"event,omitempty"`
	Message      string      `json:"message,omitempty"`
	Account      string      `json:"account,omitempty"`
	ID           string      `json:"id,omitempty"`
	Raw          string      `json:"raw,omitempty"`
	RawInterface interface{} `json:"rawInterface,omitempty"`
}

StructuredLog struct for structured loggin

Jump to

Keyboard shortcuts

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