1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 19:10: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 {
http.Handle(p, f)
}
BeeLogger.Info("Running on %s", addr)
err := http.ListenAndServe(addr, nil)
if err != nil {
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)
}
BeeLogger.Info("Running on %s", addr)
var (
err error
l net.Listener
@ -78,6 +76,7 @@ func (app *App) Run() {
if HttpsPort != 0 {
app.Server.Addr = fmt.Sprintf("%s:%d", HttpAddr, HttpsPort)
}
BeeLogger.Info("Running on %s", app.Server.Addr)
err := app.Server.ListenAndServeTLS(HttpCertFile, HttpKeyFile)
if err != nil {
BeeLogger.Critical("ListenAndServeTLS: ", err)
@ -90,6 +89,7 @@ func (app *App) Run() {
if EnableHttpListen {
go func() {
app.Server.Addr = addr
BeeLogger.Info("Running on %s", app.Server.Addr)
err := app.Server.ListenAndServe()
if err != nil {
BeeLogger.Critical("ListenAndServe: ", err)