logger

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package logger includes extended JSON logging functionality

Index

Constants

This section is empty.

Variables

View Source
var (
	// LogLevel holds the application's current log level
	LogLevel int
	// ArtifactID holds the image being used to run the application
	ArtifactID string
	// ServiceName holds the application's name in the service discovery system
	ServiceName string
)

Functions

func Debug

func Debug(message string)

Debug logs a message to stdout with the DEBUG log level

func Error

func Error(message string, errs ...error)

Error logs a message to stdout with the ERROR log level

func GinFormatter

func GinFormatter(param gin.LogFormatterParams) string

GinFormatter is used to adapt Gin's logging to the Qvantel standard

func Info

func Info(message string)

Info logs a message to stdout with the INFO log level

func Init

func Init(conf config.Config)

Init initializes the logger object

func TimeFormated

func TimeFormated(time *time.Time) string

TimeFormated Formats the provided time according to 'yyyy-MM-dd'T'HH:mm:ssZ'

func Trace

func Trace(message string)

Trace logs a message to stdout with the TRACE log level

func Warning

func Warning(message string)

Warning logs a message to stdout with the WARN log level

Types

type EventLogData

type EventLogData struct {
	TimeStamp   string `json:"@timestamp"`
	Version     string `json:"@version"`
	LogType     string `json:"log_type"`
	LogLevel    string `json:"log_level"`
	LevelValue  int    `json:"level_value"`
	ServiceName string `json:"service_name"`
	LoggerName  string `json:"logger_name"`
	ArtifactID  string `json:"artifact_id"`
	TraceToken  string `json:"trace_token"`
	Message     string `json:"message"`
}

EventLogData contains the needed information to be rendered as a logstash compatible json event log

Jump to

Keyboard shortcuts

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