Documentation ¶
Index ¶
- func InitRot(cfg *RotConfig) (*rotatelogs.RotateLogs, error)
- func InitRotZap(rotCfg RotConfig, zapCfg zap.Config) (*zap.Logger, error)
- func InitRotZapFromCfgFile(cfgName string) (*zap.Logger, error)
- func InitRotZapFromJSON(jsonStr string) (*zap.Logger, error)
- func InitRotZapFromYaml(yamlStr string) (*zap.Logger, error)
- func InitZap(cfg zap.Config, writer io.Writer) (*zap.Logger, error)
- type Config
- type RotConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitRot ¶
func InitRot(cfg *RotConfig) (*rotatelogs.RotateLogs, error)
InitRot init file-rotatelogs from config
func InitRotZap ¶
InitRotZap init file-rotatelogs and zap by config.
func InitRotZapFromCfgFile ¶
InitRotZapFromCfgFile Init file-rotatelogs and zap from a config file. Only support 'yaml' and 'json' format.
func InitRotZapFromJSON ¶
InitRotZapFromJSON init file-rotatelogs and zap from a json configuration string.
func InitRotZapFromYaml ¶
InitRotZapFromYaml init file-rotatelogs and zap from a yaml configuration string.
Types ¶
type RotConfig ¶
type RotConfig struct { Path string `json:"path" yaml:"path"` RotTime int64 `json:"rotTime" yaml:"rotTime"` RotSize int64 `json:"rotSize" yaml:"rotSize"` RotCount uint `json:"rotCount" yaml:"rotCount"` MaxAge int64 `json:"maxAge" yaml:"maxAge"` ForceNewFile bool `json:"forceNewFile" yaml:"forceNewFile"` }
RotConfig is configuration for file-rotatelogs
Click to show internal directories.
Click to hide internal directories.