|
|
@@ -56,23 +56,28 @@ var adatperSetMapper = map[Adapter]func(l *Logger, level Level) error{ |
|
|
|
} |
|
|
|
|
|
|
|
func GenAliConfig(level Level) *AliLSConfig { |
|
|
|
var project string = "gaore-app-logstore" |
|
|
|
var project = "gr-go-project" |
|
|
|
var endpoint string |
|
|
|
|
|
|
|
if os.Getenv(envkey) == "prod" || os.Getenv(envkey) == "" || os.Getenv(envkey) == "gray" { |
|
|
|
endpoint = project + ".cn-shenzhen-intranet.log.aliyuncs.com" |
|
|
|
} else if os.Getenv(envkey) == "dev" { |
|
|
|
endpoint = project + ".cn-shenzhen.log.aliyuncs.com" |
|
|
|
intranet := os.Getenv("GRLOG_INTERNET") != "public" |
|
|
|
if intranet && (os.Getenv(envkey) == "development" || os.Getenv(envkey) == "testing") { |
|
|
|
intranet = false |
|
|
|
} |
|
|
|
|
|
|
|
if intranet { |
|
|
|
endpoint = "cn-hongkong-intranet.log.aliyuncs.com" |
|
|
|
} else { |
|
|
|
endpoint = "cn-hongkong.log.aliyuncs.com" |
|
|
|
} |
|
|
|
source := os.Getenv("GRLOG_SOURCE") |
|
|
|
c := &AliLSConfig{ |
|
|
|
Project: project, |
|
|
|
Endpoint: endpoint, |
|
|
|
KeyID: "LTAI4GCHwcqtrFD4DHRHxR4k", |
|
|
|
KeySecret: "Ln19xfVYy6OMlJeF9aBvFl4fhRUKBl", |
|
|
|
LogStore: "gaore-app-logstore", |
|
|
|
Topics: []string{os.Getenv("GRLOG_APP_NAME")}, |
|
|
|
Source: "", |
|
|
|
KeyID: "LTAI5tMA7iMGFfuc3xSRVCGQ", |
|
|
|
KeySecret: "z98EpzmYmgiVLKizxP7pMF4BPbHfPV", |
|
|
|
LogStore: os.Getenv("GRLOG_APP_NAME"), |
|
|
|
Topics: []string{os.Getenv("GRLOG_TOPIC")}, |
|
|
|
Source: source, |
|
|
|
Level: level, |
|
|
|
FlushWhen: 0, |
|
|
|
} |
|
|
|