logger

package
v1.4.5-alpha1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2019 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package logger is a default implementation of InterfaceLogger declared in "github.com/ottemo/commerce/env" package.

Default logger is pretty simple implementation, which takes an message and puts it into a "storage" (a file with specific name in this case). If for some reason message can not be places in file (file access denied, etc.) message will be printed to stdout. Message time (in RFC3339 format) and specified prefix adds to message before output.

Index

Constants

View Source
const (
	ConstCollectCallStack = true // flag to indicate that call stack information within error is required

	ConstConfigPathError         = "general.error"
	ConstConfigPathErrorLogLevel = "general.error.log_level"

	ConstErrorModule = "env/logger"
	ConstErrorLevel  = env.ConstErrorLevelService
)

Package global constants

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultLogger

type DefaultLogger struct{}

DefaultLogger is a default implementer of InterfaceLogger

func (*DefaultLogger) Log

func (it *DefaultLogger) Log(storage string, prefix string, msg string)

Log is a general case logging function

func (*DefaultLogger) LogError

func (it *DefaultLogger) LogError(err error)

LogError makes error log

func (*DefaultLogger) LogEvent

func (it *DefaultLogger) LogEvent(fields env.LogFields, eventName string)

LogEvent Saves log details out to a file for logstash consumption

Jump to

Keyboard shortcuts

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