capture http servers error logs

otherwise they will be printed to stdout
This commit is contained in:
Nicola Murino
2021-01-03 10:38:28 +01:00
parent 4b522a2455
commit 6d84c5b9e3
4 changed files with 24 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ package httpd
import (
"crypto/tls"
"fmt"
"log"
"net/http"
"path/filepath"
"runtime"
@@ -154,6 +155,7 @@ func (c Conf) Initialize(configDir string) error {
WriteTimeout: 60 * time.Second,
IdleTimeout: 120 * time.Second,
MaxHeaderBytes: 1 << 16, // 64KB
ErrorLog: log.New(&logger.StdLoggerWrapper{Sender: logSender}, "", 0),
}
if certificateFile != "" && certificateKeyFile != "" {
certMgr, err = common.NewCertManager(certificateFile, certificateKeyFile, logSender)