📝 完善readme

This commit is contained in:
李寻欢 2021-12-29 14:36:38 +08:00
parent 6253de5599
commit 366919b6ef

View File

@ -11,4 +11,15 @@ func main() {
logger.InitLogger(logger.LogConfig{Mode: logger.Dev, LokiEnable: false, FileEnable: true})
logger.Say.Debug("芜湖")
}
```
### 环境变量
```shell
export LOG_MODE=0 # 0: dev, 1: prod
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 名称
```