Skip to content

Commit 5f8cb40

Browse files
committed
Fix logging documentation (go-gitea#6904)
* ENABLE_MACARON_REDIRECT should be REDIRECT_MACARON_LOG * Allow DISABLE_ROUTER_LOG to be set in the [log] section
1 parent d90115f commit 5f8cb40

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/content/doc/advanced/logging-documentation.en-us.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ multiple subloggers that will log to files.
6666

6767
By default Macaron will log to its own go `log` instance. This writes
6868
to `os.Stdout`. You can redirect this log to a Gitea configurable logger
69-
through setting the `ENABLE_MACARON_REDIRECT` setting in the `[log]`
69+
through setting the `REDIRECT_MACARON_LOG` setting in the `[log]`
7070
section which you can configure the outputs of by setting the `MACARON`
7171
value in the `[log]` section of the configuration. `MACARON` defaults
7272
to `file` if unset.
@@ -89,7 +89,7 @@ log using the value: `MACARON = ,`
8989

9090
There are two types of Router log. By default Macaron send its own
9191
router log which will be directed to Macaron's go `log`, however if you
92-
`ENABLE_MACARON_REDIRECT` you will enable Gitea's router log. You can
92+
`REDIRECT_MACARON_LOG` you will enable Gitea's router log. You can
9393
disable both types of Router log by setting `DISABLE_ROUTER_LOG`.
9494

9595
If you enable the redirect, you can configure the outputs of this

modules/setting/log.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ func newAccessLogService() {
211211

212212
func newRouterLogService() {
213213
Cfg.Section("log").Key("ROUTER").MustString("console")
214+
// Allow [log] DISABLE_ROUTER_LOG to override [server] DISABLE_ROUTER_LOG
215+
DisableRouterLog = Cfg.Section("log").Key("DISABLE_ROUTER_LOG").MustBool(DisableRouterLog)
214216

215217
if !DisableRouterLog && RedirectMacaronLog {
216218
options := newDefaultLogOptions()

0 commit comments

Comments
 (0)