ipld-eth-server/main.go
Edvard Hübinette 2c092e8d04
[VDB-751 VDB-754] Bugfix null pointer panic and improve logging (#119)
* VDB-751 VDB-754 Bugfix null pointer panic and improve logging

* Fix typo
2019-07-18 09:21:40 +02:00

25 lines
429 B
Go

package main
import (
"github.com/vulcanize/vulcanizedb/cmd"
log "github.com/sirupsen/logrus"
"os"
)
func main() {
log.SetFormatter(&log.JSONFormatter{
PrettyPrint: true,
})
log.SetReportCaller(true)
file, err := os.OpenFile("vulcanizedb.log",
os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
if err == nil {
log.SetOutput(file)
} else {
log.Info("Failed to log to file, using default stderr")
}
cmd.Execute()
}