joaonrb
joaonrb

Reputation: 1021

How make Beego log access in production mode?

I'm having some trouble to set the right log configuration in Beego for production mod. While developing the log keeps on printing access logs but in production it stop. Even 404 are not printed. I tried to set the log level to Debug and set a new file logger but it still not printing access log.

func main() {
    runtime.GOMAXPROCS(8)
    beego.SetLevel(beego.LevelDebug)
    beego.SetLogger("file", `{"filename":"logs/test.log"}`)
    beego.Run()
}

Any help with this?

Upvotes: 2

Views: 2144

Answers (3)

Kotori0
Kotori0

Reputation: 147

As for latest Beego, it would look like this.

func main() {
    beego.BConfig.Log.AccessLogs = true
    beego.Run()
}

Upvotes: 0

Pavel Nemtsev
Pavel Nemtsev

Reputation: 31

func main() {
    beego.AccessLogs = true
    beego.Run()
}

Upvotes: 2

joaonrb
joaonrb

Reputation: 1021

It looks that the developers of Beego did this on purpose. Beego in production mode don't print access logs. Check the issue here.

Upvotes: 0

Related Questions