Documentation ¶
Overview ¶
elasticsearch 日志存储组件
zap日志记录组件
Index ¶
- Variables
- func CreateElasticLog(level, IndexName, msg string, filedSlice ...ExtendFields) (string, error)
- func CreateFileLog(level, msg string, filedSlice ...ExtendFields)
- func InitElastic(conf pelastic.ElastiConfig)
- func InitLocal(conf LogFileConfig)
- type ExtendFields
- type LogFileConfig
- type Output
- func (c *Output) Debug(cate, msg string, filedSlice ...ExtendFields)
- func (c *Output) Error(cate, msg string, filedSlice ...ExtendFields)
- func (c *Output) Fatal(cate, msg string, filedSlice ...ExtendFields)
- func (c *Output) Info(cate, msg string, filedSlice ...ExtendFields)
- func (c *Output) Panic(cate, msg string, filedSlice ...ExtendFields)
- func (c *Output) Warn(cate, msg string, filedSlice ...ExtendFields)
- type StandLog
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Logger *zap.Logger
)
Functions ¶
func CreateElasticLog ¶
func CreateElasticLog(level, IndexName, msg string, filedSlice ...ExtendFields) (string, error)
CreateElasticLog 创建日志文档 level: string 错误等级 IndexName: string 索引名称 msg: string 消息文本 filedSlice: []ExtendFields 额外参数
func CreateFileLog ¶
func CreateFileLog(level, msg string, filedSlice ...ExtendFields)
CreateFileLog 创建日志文件 level: string 错误等级 msg: string 消息文本 filedSlice: []ExtendFields 额外参数
func InitLocal ¶
func InitLocal(conf LogFileConfig)
Types ¶
type ExtendFields ¶
type ExtendFields struct { Key string Value interface{} }
日志内容自定义数据key=>value结构体
type LogFileConfig ¶
type Output ¶
type Output struct {
// contains filtered or unexported fields
}
func InitLogger ¶
InitLogger 日志服务初始化 conf: interface{}
func (*Output) Debug ¶
func (c *Output) Debug(cate, msg string, filedSlice ...ExtendFields)
func (*Output) Error ¶
func (c *Output) Error(cate, msg string, filedSlice ...ExtendFields)
func (*Output) Fatal ¶
func (c *Output) Fatal(cate, msg string, filedSlice ...ExtendFields)
func (*Output) Info ¶
func (c *Output) Info(cate, msg string, filedSlice ...ExtendFields)
func (*Output) Panic ¶
func (c *Output) Panic(cate, msg string, filedSlice ...ExtendFields)
func (*Output) Warn ¶
func (c *Output) Warn(cate, msg string, filedSlice ...ExtendFields)
type StandLog ¶
type StandLog interface { Debug(cate, msg string, filedSlice ...ExtendFields) // debug 级别日志 Info(cate, msg string, filedSlice ...ExtendFields) // info 级别日志 Warn(cate, msg string, filedSlice ...ExtendFields) // warn 级别日志 Error(cate, msg string, filedSlice ...ExtendFields) // error 级别日志 Panic(cate, msg string, filedSlice ...ExtendFields) // panic 级别日志 Fatal(cate, msg string, filedSlice ...ExtendFields) // fatal 级别日志 }
定义日志输出的接口方法
Click to show internal directories.
Click to hide internal directories.