github.com/gogf/gf@v1.16.9/.example/net/ghttp/server/log/log_error.go (about)

     1  package main
     2  
     3  import (
     4  	"github.com/gogf/gf/net/ghttp"
     5  )
     6  
     7  func main() {
     8  	s := ghttp.GetServer()
     9  	s.BindHandler("/log/error", func(r *ghttp.Request) {
    10  		panic("OMG")
    11  	})
    12  	s.SetErrorLogEnabled(true)
    13  	s.SetPort(8199)
    14  	s.Run()
    15  }