2022-05-18 17:43:19 +08:00
2022-05-18 17:43:19 +08:00
2022-05-18 11:17:22 +08:00
2021-12-14 10:53:50 +08:00
2022-10-20 11:48:25 +08:00
2022-05-19 09:01:05 +08:00
2022-05-19 09:01:05 +08:00
2022-10-25 16:27:54 +08:00
2022-05-18 18:53:17 +08:00
2022-05-18 18:53:17 +08:00
2022-05-18 18:13:20 +08:00

Logger

基于Zap整合的日志框架可自由组合输出到Console、File、Loki

Demo

package main

import (
	"gitee.ltd/lxh/logger"
	"gitee.ltd/lxh/logger/log"
)

func main() {
	logger.InitLogger(logger.LogConfig{Mode: logger.Dev, LokiEnable: false, FileEnable: true})
	log.Debug("芜湖")
}

环境变量

export LOG_MODE=0 # development | production
export LOG_LOKI_ENABLE=1 # 是否启用Loki 0: disable, 1: enable
export LOG_FILE_ENABLE=0 # 是否启用输出到文件 0: disable, 1: enable
export LOG_LOKI_HOST=10.0.0.31 # Loki地址
export LOG_LOKI_PORT=3100 # Loki端口
export LOG_LOKI_SOURCE_NAME=tests # Loki Source 名称
export LOG_LOKI_JOB_NAME=testj # Loki Job 名称
Description
基于Zap整合的日志框架,可自由组合输出到Console、File、Loki
Readme 152 KiB
Languages
Go 100%