mirror of
https://github.com/Jinnrry/PMail.git
synced 2025-02-20 11:43:09 +08:00
add log
This commit is contained in:
parent
2ec333f6f5
commit
712873370a
@ -2,6 +2,7 @@ package http_server
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
"pmail/config"
|
||||
@ -28,6 +29,8 @@ func HttpStart() {
|
||||
HttpPort = config.Instance.HttpPort
|
||||
}
|
||||
|
||||
log.Infof("HttpServer Start On Port :%d", HttpPort)
|
||||
|
||||
if config.Instance.HttpsEnabled != 2 {
|
||||
mux.HandleFunc("/", controllers.Interceptor)
|
||||
httpServer = &http.Server{
|
||||
|
@ -34,7 +34,6 @@ func (w *nullWrite) Write(p []byte) (int, error) {
|
||||
}
|
||||
|
||||
func HttpsStart() {
|
||||
log.Infof("Http Server Start")
|
||||
|
||||
mux := http.NewServeMux()
|
||||
|
||||
@ -73,6 +72,8 @@ func HttpsStart() {
|
||||
HttpsPort = config.Instance.HttpsPort
|
||||
}
|
||||
|
||||
log.Infof("Https Server Start On Port :%d", HttpsPort)
|
||||
|
||||
if config.Instance.HttpsEnabled != 2 {
|
||||
httpsServer = &http.Server{
|
||||
Addr: fmt.Sprintf(":%d", HttpsPort),
|
||||
|
@ -1,6 +1,7 @@
|
||||
package res_init
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"os"
|
||||
"pmail/config"
|
||||
@ -39,6 +40,10 @@ func Init() {
|
||||
// http server start
|
||||
go http_server.HttpsStart()
|
||||
go http_server.HttpStart()
|
||||
|
||||
configStr, _ := json.Marshal(config.Instance)
|
||||
log.Warnf("Config File Info: %s", configStr)
|
||||
|
||||
<-signal.RestartChan
|
||||
log.Infof("Server Restart!")
|
||||
smtp_server.Stop()
|
||||
|
Loading…
x
Reference in New Issue
Block a user