mirror of
https://github.com/matrix-org/dendrite
synced 2024-12-14 08:03:49 +01:00
cmd: Configure logging before any log messages
This commit is contained in:
parent
254e61f727
commit
f65e26bc2a
2 changed files with 4 additions and 2 deletions
|
@ -16,11 +16,12 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
common.SetupLogging(os.Getenv("LOG_DIR"))
|
||||||
|
|
||||||
bindAddr := os.Getenv("BIND_ADDRESS")
|
bindAddr := os.Getenv("BIND_ADDRESS")
|
||||||
if bindAddr == "" {
|
if bindAddr == "" {
|
||||||
log.Panic("No BIND_ADDRESS environment variable found.")
|
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
|
// TODO: Rather than generating a new key on every startup, we should be
|
||||||
// reading a PEM formatted file instead.
|
// reading a PEM formatted file instead.
|
||||||
|
|
|
@ -34,6 +34,8 @@ func loadConfig(configPath string) (*config.Sync, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
common.SetupLogging(os.Getenv("LOG_DIR"))
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
if *configPath == "" {
|
if *configPath == "" {
|
||||||
|
@ -47,7 +49,6 @@ func main() {
|
||||||
if *bindAddr == "" {
|
if *bindAddr == "" {
|
||||||
log.Fatal("--listen must be supplied")
|
log.Fatal("--listen must be supplied")
|
||||||
}
|
}
|
||||||
common.SetupLogging(os.Getenv("LOG_DIR"))
|
|
||||||
|
|
||||||
log.Info("sync server config: ", cfg)
|
log.Info("sync server config: ", cfg)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue