1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 13:00:54 +00:00

beego: improve the log debug for running server

This commit is contained in:
astaxie 2014-09-05 17:04:02 +08:00
parent 08b3e4191e
commit f7cd1479ba
2 changed files with 3 additions and 2 deletions

View File

@ -458,6 +458,7 @@ func (admin *adminApp) Run() {
for p, f := range admin.routers { for p, f := range admin.routers {
http.Handle(p, f) http.Handle(p, f)
} }
BeeLogger.Info("Running on %s", addr)
err := http.ListenAndServe(addr, nil) err := http.ListenAndServe(addr, nil)
if err != nil { if err != nil {
BeeLogger.Critical("Admin ListenAndServe: ", err) BeeLogger.Critical("Admin ListenAndServe: ", err)

4
app.go
View File

@ -48,8 +48,6 @@ func (app *App) Run() {
addr = fmt.Sprintf("%s:%d", HttpAddr, HttpPort) addr = fmt.Sprintf("%s:%d", HttpAddr, HttpPort)
} }
BeeLogger.Info("Running on %s", addr)
var ( var (
err error err error
l net.Listener l net.Listener
@ -78,6 +76,7 @@ func (app *App) Run() {
if HttpsPort != 0 { if HttpsPort != 0 {
app.Server.Addr = fmt.Sprintf("%s:%d", HttpAddr, HttpsPort) app.Server.Addr = fmt.Sprintf("%s:%d", HttpAddr, HttpsPort)
} }
BeeLogger.Info("Running on %s", app.Server.Addr)
err := app.Server.ListenAndServeTLS(HttpCertFile, HttpKeyFile) err := app.Server.ListenAndServeTLS(HttpCertFile, HttpKeyFile)
if err != nil { if err != nil {
BeeLogger.Critical("ListenAndServeTLS: ", err) BeeLogger.Critical("ListenAndServeTLS: ", err)
@ -90,6 +89,7 @@ func (app *App) Run() {
if EnableHttpListen { if EnableHttpListen {
go func() { go func() {
app.Server.Addr = addr app.Server.Addr = addr
BeeLogger.Info("Running on %s", app.Server.Addr)
err := app.Server.ListenAndServe() err := app.Server.ListenAndServe()
if err != nil { if err != nil {
BeeLogger.Critical("ListenAndServe: ", err) BeeLogger.Critical("ListenAndServe: ", err)