Fix logging documentation (#6904)

* ENABLE_MACARON_REDIRECT should be REDIRECT_MACARON_LOG

* Allow DISABLE_ROUTER_LOG to be set in the [log] section
pull/6905/head^2
zeripath 6 years ago committed by GitHub
parent f378cb572a
commit e3166744fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      docs/content/doc/advanced/logging-documentation.en-us.md
  2. 2
      modules/setting/log.go

@ -66,7 +66,7 @@ multiple subloggers that will log to files.
By default Macaron will log to its own go `log` instance. This writes By default Macaron will log to its own go `log` instance. This writes
to `os.Stdout`. You can redirect this log to a Gitea configurable logger to `os.Stdout`. You can redirect this log to a Gitea configurable logger
through setting the `ENABLE_MACARON_REDIRECT` setting in the `[log]` through setting the `REDIRECT_MACARON_LOG` setting in the `[log]`
section which you can configure the outputs of by setting the `MACARON` section which you can configure the outputs of by setting the `MACARON`
value in the `[log]` section of the configuration. `MACARON` defaults value in the `[log]` section of the configuration. `MACARON` defaults
to `file` if unset. to `file` if unset.
@ -89,7 +89,7 @@ log using the value: `MACARON = ,`
There are two types of Router log. By default Macaron send its own There are two types of Router log. By default Macaron send its own
router log which will be directed to Macaron's go `log`, however if you router log which will be directed to Macaron's go `log`, however if you
`ENABLE_MACARON_REDIRECT` you will enable Gitea's router log. You can `REDIRECT_MACARON_LOG` you will enable Gitea's router log. You can
disable both types of Router log by setting `DISABLE_ROUTER_LOG`. disable both types of Router log by setting `DISABLE_ROUTER_LOG`.
If you enable the redirect, you can configure the outputs of this If you enable the redirect, you can configure the outputs of this

@ -211,6 +211,8 @@ func newAccessLogService() {
func newRouterLogService() { func newRouterLogService() {
Cfg.Section("log").Key("ROUTER").MustString("console") Cfg.Section("log").Key("ROUTER").MustString("console")
// Allow [log] DISABLE_ROUTER_LOG to override [server] DISABLE_ROUTER_LOG
DisableRouterLog = Cfg.Section("log").Key("DISABLE_ROUTER_LOG").MustBool(DisableRouterLog)
if !DisableRouterLog && RedirectMacaronLog { if !DisableRouterLog && RedirectMacaronLog {
options := newDefaultLogOptions() options := newDefaultLogOptions()

Loading…
Cancel
Save