cmd: Configure logging before any log messages
MODIFY
src/github.com/matrix-org/dendrite/cmd/dendrite-clientapi/main.go
src/github.com/matrix-org/dendrite/cmd/dendrite-clientapi/main.go
@@ -16,11 +16,12 @@ import (
)
func main() {
+ common.SetupLogging(os.Getenv("LOG_DIR"))
+
bindAddr := os.Getenv("BIND_ADDRESS")
if bindAddr == "" {
log.Panic("No BIND_ADDRESS environment variable found.")
}
- common.SetupLogging(os.Getenv("LOG_DIR"))
// TODO: Rather than generating a new key on every startup, we should be
// reading a PEM formatted file instead.

MODIFY
src/github.com/matrix-org/dendrite/cmd/dendrite-sync-server/main.go
src/github.com/matrix-org/dendrite/cmd/dendrite-sync-server/main.go
@@ -34,6 +34,8 @@ func loadConfig(configPath string) (*config.Sync, error) {
}
func main() {
+ common.SetupLogging(os.Getenv("LOG_DIR"))
+
flag.Parse()
if *configPath == "" {
@@ -47,7 +49,6 @@ func main() {
if *bindAddr == "" {
log.Fatal("--listen must be supplied")
}
- common.SetupLogging(os.Getenv("LOG_DIR"))
log.Info("sync server config: ", cfg)

cmd: Configure logging before any log messages