Skip to content

Commit

Permalink
log MongoDB driver version
Browse files Browse the repository at this point in the history
  • Loading branch information
rwynn committed Sep 12, 2019
1 parent e1d011b commit a3500c8
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions monstache.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,27 @@ import (
"errors"
"flag"
"fmt"
"io/ioutil"
"log"
"math"
"net/http"
"net/http/pprof"
"os"
"os/signal"
"plugin"
"reflect"
"regexp"
"strconv"
"strings"
"sync"
"syscall"
"text/template"
"time"

"github.com/BurntSushi/toml"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/coreos/go-systemd/daemon"
"github.com/evanphx/json-patch"
jsonpatch "github.com/evanphx/json-patch"
"github.com/olivere/elastic"
aws "github.com/olivere/elastic/aws/v4"
"github.com/robertkrimen/otto"
Expand All @@ -28,24 +45,9 @@ import (
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/gridfs"
"go.mongodb.org/mongo-driver/mongo/options"
mongoversion "go.mongodb.org/mongo-driver/version"
"gopkg.in/Graylog2/go-gelf.v2/gelf"
"gopkg.in/natefinch/lumberjack.v2"
"io/ioutil"
"log"
"math"
"net/http"
"net/http/pprof"
"os"
"os/signal"
"plugin"
"reflect"
"regexp"
"strconv"
"strings"
"sync"
"syscall"
"text/template"
"time"
)

var infoLog = log.New(os.Stdout, "INFO ", log.Flags())
Expand Down Expand Up @@ -4366,6 +4368,7 @@ func buildMongoClient(config *configOptions) *mongo.Client {
cleanMongoURL(config.MongoURL), err)
}
infoLog.Printf("Started monstache version %s", version)
infoLog.Printf("MongoDB go driver %s", mongoversion.Driver)
if mongoInfo, err := getBuildInfo(mongoClient); err == nil {
infoLog.Printf("Successfully connected to MongoDB version %s", mongoInfo.Version)
} else {
Expand Down

0 comments on commit a3500c8

Please sign in to comment.