修改 topic 默认值
This commit is contained in:
parent
98a6e56cb8
commit
30b584f0bd
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,3 +8,4 @@
|
|||||||
out
|
out
|
||||||
gen
|
gen
|
||||||
runtime
|
runtime
|
||||||
|
/vendor
|
@ -70,13 +70,18 @@ func GenAliConfig(level Level) *AliLSConfig {
|
|||||||
endpoint = "cn-hongkong.log.aliyuncs.com"
|
endpoint = "cn-hongkong.log.aliyuncs.com"
|
||||||
}
|
}
|
||||||
source := os.Getenv("GRLOG_SOURCE")
|
source := os.Getenv("GRLOG_SOURCE")
|
||||||
|
appName := os.Getenv("GRLOG_APP_NAME")
|
||||||
|
topic := os.Getenv("GRLOG_TOPIC")
|
||||||
|
if topic == "" {
|
||||||
|
topic = appName
|
||||||
|
}
|
||||||
c := &AliLSConfig{
|
c := &AliLSConfig{
|
||||||
Project: project,
|
Project: project,
|
||||||
Endpoint: endpoint,
|
Endpoint: endpoint,
|
||||||
KeyID: "LTAI5tMA7iMGFfuc3xSRVCGQ",
|
KeyID: "LTAI5tMA7iMGFfuc3xSRVCGQ",
|
||||||
KeySecret: "z98EpzmYmgiVLKizxP7pMF4BPbHfPV",
|
KeySecret: "z98EpzmYmgiVLKizxP7pMF4BPbHfPV",
|
||||||
LogStore: os.Getenv("GRLOG_APP_NAME"),
|
LogStore: appName,
|
||||||
Topics: []string{os.Getenv("GRLOG_TOPIC")},
|
Topics: []string{topic},
|
||||||
Source: source,
|
Source: source,
|
||||||
Level: level,
|
Level: level,
|
||||||
FlushWhen: 0,
|
FlushWhen: 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user