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