Back to godoc.org

Package logging

v0.0.0-...-6e78f20
Latest Go to latest

The latest major version is .

Published: Oct 28, 2019 | License: Apache-2.0 | Module: github.com/chenwbyx/leafserver

Index

Constants

const (
	MAXSIZE    = 8
	MAXBACKUPS = 2
	MAXAGE     = 7
)

Variables

var (
	AppLogger     *zap.Logger
	HTTPLogger    *zap.Logger
	DefaultLogger *zap.Logger
	LoginLogger   *zap.Logger
)

func NewLogger

func NewLogger(filePath string, level zapcore.Level, maxSize int, maxBackups int, maxAge int, compress bool, serviceName string) *zap.Logger

*

* 获取日志
* filePath 日志文件路径
* level 日志级别
* maxSize 每个日志文件保存的最大尺寸 单位:M
* maxBackups 日志文件最多保存多少个备份
* maxAge 文件最多保存多少天
* compress 是否压缩
* serviceName 服务名

func Setup

func Setup()

定制日志

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier