Skip to content

Commit

Permalink
Display elasticsearch client info
Browse files Browse the repository at this point in the history
  • Loading branch information
javuto committed Oct 29, 2024
1 parent 536f73b commit d80e3e0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions logging/elastic.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ func CreateLoggerElastic(elasticFile string) (*LoggerElastic, error) {
es, err := elasticsearch.NewClient(cfg)
if err != nil {
return nil, err
} else {
log.Info().Msg("Elasticsearch client created")
infoRes, err := es.Info()
if err != nil {
log.Err(err).Msg("Error getting Elasticsearch info")
} else {
defer infoRes.Body.Close()
log.Info().Msgf("Elasticsearch info: %s", infoRes)
}
}
l := &LoggerElastic{
Configuration: config,
Expand Down

0 comments on commit d80e3e0

Please sign in to comment.