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

@@ -5,6 +5,7 @@ import (
"crypto/tls"
"errors"
"fmt"
"log"
"net/http"
"path"
"path/filepath"
@@ -42,6 +43,7 @@ func (s *webDavServer) listenAndServe() error {
ReadHeaderTimeout: 30 * time.Second,
IdleTimeout: 120 * time.Second,
MaxHeaderBytes: 1 << 16, // 64KB
ErrorLog: log.New(&logger.StdLoggerWrapper{Sender: logSender}, "", 0),
}
if s.config.Cors.Enabled {
c := cors.New(cors.Options{