logging

package
v0.0.0-...-6e78f20 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

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

Variables

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

Functions

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()

定制日志

Types

This section is empty.

Jump to

Keyboard shortcuts

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