Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
0fdc766841
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
39 lines (33 sloc) 726 Bytes
package main
import (
"io/ioutil"
"log"
"math/rand"
"time"
"code.cloudfoundry.org/loggregator/profiler"
"code.cloudfoundry.org/loggregator/router/app"
"google.golang.org/grpc/grpclog"
)
func main() {
rand.Seed(time.Now().UnixNano())
grpclog.SetLogger(log.New(ioutil.Discard, "", 0))
conf, err := app.LoadConfig()
if err != nil {
log.Fatalf("Unable to parse config: %s", err)
}
r := app.NewRouter(
conf.GRPC,
app.WithPersistence(
conf.MaxRetainedLogMessages,
conf.ContainerMetricTTLSeconds,
conf.SinkInactivityTimeoutSeconds,
),
app.WithMetricReporting(
conf.HealthAddr,
conf.Agent,
conf.MetricBatchIntervalMilliseconds,
),
)
r.Start()
profiler.New(conf.PProfPort).Start()
}