persist

package
v0.0.0-...-781f026 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileLog

func NewFileLog(name string, rotationTime time.Duration, rotationBytes FileSize) (logo.Persister, error)

NewFileLog 创建文件持久化器 name: 日志文件前缀 rotationTime: 日志文件切割的间隔时间,为0忽略 rotationBytes: 触发日志文件切割的大小,为0忽略 level: 仅保存<=level级别的日志,可以实现分文件保存不同级别日志

func NewFluentLog

func NewFluentLog(network, addrs string, port int, tag string) (logo.Persister, error)

NewFluentLog 创建fluentPersister对象 network可选tcp/unix,addrs为addr(tcp) or path(unix)

func NewStdoutLog

func NewStdoutLog() (logo.Persister, error)

NewStdoutLog 创建标准输出持久化器

func NewSyslog

func NewSyslog(network, raddr string, priority syslog.Priority, tag string) (logo.Persister, error)

NewSyslog 创建syslog的Persister对象 network为空时连接到本地系统,tag为空使用os.Args[0]

Types

type FileSize

type FileSize int64

FileSize means file size

const (
	B FileSize = 1 << (10 * iota)
	KB
	MB
	GB
	TB
	PB
)

file size enum

Jump to

Keyboard shortcuts

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