mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 18:40:55 +00:00
beego: improve the log debug for running server
This commit is contained in:
parent
08b3e4191e
commit
f7cd1479ba
1
admin.go
1
admin.go
@ -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
4
app.go
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user