Add loger to elastic search client
This commit is contained in:
parent
7d0aefacbb
commit
0962e73e3e
@ -5,14 +5,16 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/elastic/go-elasticsearch/v7"
|
||||
"github.com/elastic/go-elasticsearch/v7/esapi"
|
||||
"github.com/elastic/go-elasticsearch/v7/estransport"
|
||||
)
|
||||
|
||||
const (
|
||||
ElasticSearch_INDEX = "lotus"
|
||||
ElasticSearch_INDEX = "lotus2"
|
||||
|
||||
ElasticSearch_DOC_LOTUS = "doc_lotus"
|
||||
ElasticSearch_DOC_PUBSUB = "doc_pubsub"
|
||||
@ -29,6 +31,11 @@ func NewElasticSearchTransport(connectionString string) (TracerTransport, error)
|
||||
},
|
||||
Username: username,
|
||||
Password: password,
|
||||
Logger: &estransport.CurlLogger{
|
||||
Output: os.Stdout,
|
||||
EnableRequestBody: true,
|
||||
EnableResponseBody: true,
|
||||
},
|
||||
}
|
||||
|
||||
es, err := elasticsearch.NewClient(cfg)
|
||||
|
Loading…
Reference in New Issue
Block a user