logger

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogRoot                = "./logs"
	TIDYPATH          bool = true // 精简文件路径
	MAXLOGSIZE             = 200  // 文件最大尺寸
	INFOLEVEL              = 4    // 1-6  ,默认4
	DISABLEHTMLESCAPE      = true
	CONSOLEOUT             = false

	ESHOOK_ENABLE     = false
	INFLUXHOOK_ENABLE = false
)

todo 配置文件

Variables

View Source
var (
	ROTATIONTIME = time.Hour * 24     // 日志周期(默认每86400秒/一天旋转一次)
	WITHMAXAGE   = time.Hour * 24 * 7 // 默认值:-1
)

Functions

func ESHook

func ESHook(prefix string) (logrus.Hook, error)

Es hook

func InfluxDBHook

func InfluxDBHook(prefix string) (logrus.Hook, error)

InfluxDb Hook

func Init

func Init()

设置日志规则 todo 配置hook时,无须log文件

func MultiSplitHook

func MultiSplitHook(prefix string) (hk logrus.Hook, err error)

本地日志多文件切分Hook

Types

This section is empty.

Jump to

Keyboard shortcuts

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