2018-01-25 19:21:55 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2018-01-26 00:08:26 +00:00
|
|
|
"github.com/vulcanize/vulcanizedb/cmd"
|
2018-09-04 20:10:15 +00:00
|
|
|
|
2018-11-21 04:47:01 +00:00
|
|
|
log "github.com/sirupsen/logrus"
|
2018-09-04 20:10:15 +00:00
|
|
|
"github.com/spf13/viper"
|
2018-09-04 16:35:38 +00:00
|
|
|
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
|
2018-11-21 04:47:01 +00:00
|
|
|
"os"
|
2018-01-25 19:21:55 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2018-11-21 04:47:01 +00:00
|
|
|
log.SetFormatter(&log.JSONFormatter{})
|
2019-03-05 10:30:22 +00:00
|
|
|
file, err := os.OpenFile("vulcanizedb.log",
|
|
|
|
os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
|
2018-11-21 04:47:01 +00:00
|
|
|
if err == nil {
|
|
|
|
log.SetOutput(file)
|
|
|
|
} else {
|
|
|
|
log.Info("Failed to log to file, using default stderr")
|
|
|
|
}
|
|
|
|
|
2018-09-04 20:10:15 +00:00
|
|
|
tracer.Start(tracer.WithServiceName(viper.GetString("datadog.name")))
|
|
|
|
|
2018-01-25 19:21:55 +00:00
|
|
|
cmd.Execute()
|
2018-09-04 20:10:15 +00:00
|
|
|
|
|
|
|
defer tracer.Stop()
|
2018-01-25 19:21:55 +00:00
|
|
|
}
|