Browse Source

v1.3.3 暴露两个配置方法

tags/v1.3.4
liangzy 4 years ago
parent
commit
cd94900f19
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      funtion.go

+ 4
- 4
funtion.go View File

@@ -55,7 +55,7 @@ var adatperSetMapper = map[Adapter]func(l *Logger, level Level) error{
},
}

func GenAliConfig(level Level) AliLSConfig {
func GenAliConfig(level Level) *AliLSConfig {
var project string = "gaore-app-logstore"
var endpoint string

@@ -65,7 +65,7 @@ func GenAliConfig(level Level) AliLSConfig {
endpoint = project + ".cn-shenzhen.log.aliyuncs.com"
}

c := AliLSConfig{
c := &AliLSConfig{
Project: project,
Endpoint: endpoint,
KeyID: "LTAI4GCHwcqtrFD4DHRHxR4k",
@@ -79,13 +79,13 @@ func GenAliConfig(level Level) AliLSConfig {
return c
}

func GenEsConfig(level Level) EsConfig {
func GenEsConfig(level Level) *EsConfig {
dsn := "http://es-cn-0pp1mm3hq000dnbh4.public.elasticsearch.aliyuncs.com:9200/"
if os.Getenv(envkey) == "prod" || os.Getenv(envkey) == "" || os.Getenv(envkey) == "gray" {
dsn = "http://es-cn-0pp1mm3hq000dnbh4.elasticsearch.aliyuncs.com:9200/"
}

c := EsConfig{
c := &EsConfig{
Username: "elastic",
Password: "Hellogaore@",
Dsn: dsn,


Loading…
Cancel
Save