修改 topic 默认值

This commit is contained in:
余 欣怀 2023-03-13 20:58:37 +08:00
parent 98a6e56cb8
commit 30b584f0bd
2 changed files with 8 additions and 2 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@
out
gen
runtime
/vendor

View File

@ -70,13 +70,18 @@ func GenAliConfig(level Level) *AliLSConfig {
endpoint = "cn-hongkong.log.aliyuncs.com"
}
source := os.Getenv("GRLOG_SOURCE")
appName := os.Getenv("GRLOG_APP_NAME")
topic := os.Getenv("GRLOG_TOPIC")
if topic == "" {
topic = appName
}
c := &AliLSConfig{
Project: project,
Endpoint: endpoint,
KeyID: "LTAI5tMA7iMGFfuc3xSRVCGQ",
KeySecret: "z98EpzmYmgiVLKizxP7pMF4BPbHfPV",
LogStore: os.Getenv("GRLOG_APP_NAME"),
Topics: []string{os.Getenv("GRLOG_TOPIC")},
LogStore: appName,
Topics: []string{topic},
Source: source,
Level: level,
FlushWhen: 0,