logging

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(config Config) zerolog.Logger

Configure sets up the logging framework

In production, the container logs will be collected and file logging should be disabled. However, during development it's nicer to see logs as text and optionally write to a file when debugging problems in the containerized pipeline

The output logging file should be located at /var/logging/service-xyz/service-xyz.logging and will be rolled according to configuration set.

func NewZHcLog

func NewZHcLog(l *zerolog.Logger, name string) hclog.Logger

NewZHcLog Creates hclog.Logger adapter from a zerolog log

Types

type Config

type Config struct {
	// Enable console logging
	ConsoleLoggingEnabled bool `hcl:"enable_console_logging,optional"`
	// Enable Verbose logging
	Verbose bool `hcl:"verbose,optional"`
	// EncodeLogsAsJson makes the logging framework logging JSON
	EncodeLogsAsJson bool `hcl:"encode_logs_as_json,optional"`
	// FileLoggingEnabled makes the framework logging to a file
	// the fields below can be skipped if this value is false!
	FileLoggingEnabled bool `hcl:"file_logging_enabled,optional"`
	// Directory to logging to to when file logging is enabled
	Directory string `hcl:"directory,optional"`
	// Filename is the name of the logfile which will be placed inside the directory
	Filename string `hcl:"filename,optional"`
	// MaxSize the max size in MB of the logfile before it's rolled
	MaxSize int `hcl:"max_size,optional"`
	// MaxBackups the max number of rolled files to keep
	MaxBackups int `hcl:"max_backups,optional"`
	// MaxAge the max age in days to keep a logfile
	MaxAge int `hcl:"max_age,optional"`
	// Console logging will be without color, console logging must be enabled first.
	ConsoleNoColor bool `hcl:"console_no_color,optional"`
	// contains filtered or unexported fields
}

Config for logging

type ZerologKVAdapter

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

func (ZerologKVAdapter) Debug

func (z ZerologKVAdapter) Debug(msg string, args ...interface{})

func (ZerologKVAdapter) Error

func (z ZerologKVAdapter) Error(msg string, args ...interface{})

func (ZerologKVAdapter) ImpliedArgs

func (z ZerologKVAdapter) ImpliedArgs() []interface{}

func (ZerologKVAdapter) Info

func (z ZerologKVAdapter) Info(msg string, args ...interface{})

func (ZerologKVAdapter) IsDebug

func (z ZerologKVAdapter) IsDebug() bool

func (ZerologKVAdapter) IsError

func (z ZerologKVAdapter) IsError() bool

func (ZerologKVAdapter) IsInfo

func (z ZerologKVAdapter) IsInfo() bool

func (ZerologKVAdapter) IsTrace

func (z ZerologKVAdapter) IsTrace() bool

func (ZerologKVAdapter) IsWarn

func (z ZerologKVAdapter) IsWarn() bool

func (ZerologKVAdapter) Log

func (z ZerologKVAdapter) Log(level hclog.Level, msg string, args ...interface{})

func (ZerologKVAdapter) Name

func (z ZerologKVAdapter) Name() string

func (ZerologKVAdapter) Named

func (z ZerologKVAdapter) Named(name string) hclog.Logger

func (ZerologKVAdapter) ResetNamed

func (z ZerologKVAdapter) ResetNamed(name string) hclog.Logger

func (*ZerologKVAdapter) SetLevel

func (z *ZerologKVAdapter) SetLevel(level hclog.Level)

func (ZerologKVAdapter) StandardLogger

func (z ZerologKVAdapter) StandardLogger(opts *hclog.StandardLoggerOptions) *log.Logger

func (ZerologKVAdapter) StandardWriter

func (z ZerologKVAdapter) StandardWriter(opts *hclog.StandardLoggerOptions) io.Writer

func (ZerologKVAdapter) Trace

func (z ZerologKVAdapter) Trace(msg string, args ...interface{})

func (ZerologKVAdapter) Warn

func (z ZerologKVAdapter) Warn(msg string, args ...interface{})

func (ZerologKVAdapter) With

func (z ZerologKVAdapter) With(args ...interface{}) hclog.Logger

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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