logger

package
v0.0.0-...-7a3883e Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccessLogFileSize20M  int64 = 20 * 1024 * 1024
	AccessLogFileSize50M  int64 = 50 * 1024 * 1024
	AccessLogFileSize200M int64 = 200 * 1024 * 1024
)

Constants

View Source
const (
	RecordingTypeFilelog = "filelog"
	RecordingTypeEFK     = "efk"

	LogRotatorCronDaily   = "0 0 0 * * ?"
	LogRotatorCronWeekly  = "0 0 0 ? * 1"
	LogRotatorCronMonthly = "0 0 0 1 * ?"

	LogRotatorExpiresMonthly = 30
	LogRotatorExpiresWeekly  = 7
	LogRotatorExpiresSeason  = 90
	LogRotatorExpiresYearly  = 365
)

Constant

Variables

Variables

View Source
var (
	AccessLogFileMaxBytes = AccessLogFileSize20M
)

Variables

Functions

func Init

func Init(loggerConfig *Logger) error

Init initializer

func InitFluentdLogger

func InitFluentdLogger(host string, port int, level LogLevel)

InitFluentdLogger logger

func IsDebugEnabled

func IsDebugEnabled() bool

IsDebugEnabled boolean

func NewAccessLogger

func NewAccessLogger() (h iris.Handler, closer func() error)

NewAccessLogger logger

Types

type LogLevel

type LogLevel int

LogLevel type

const (
	LogLevelTrace LogLevel = iota
	LogLevelDebug
	LogLevelInfo
	LogLevelWarning
	LogLevelError
	LogLevelFatal
)

LogLevels

type Logger

type Logger struct {
	Level      string `yaml:"level"`
	Type       string `yaml:"type"`
	Address    string `yaml:"address"`
	RemoteType string `yaml:"udp"`
}

Logger struct

Jump to

Keyboard shortcuts

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