Skip to content

Fix logging documentation #6904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/content/doc/advanced/logging-documentation.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ multiple subloggers that will log to files.

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
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`
value in the `[log]` section of the configuration. `MACARON` defaults
to `file` if unset.
Expand All @@ -89,7 +89,7 @@ log using the value: `MACARON = ,`

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
`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`.

If you enable the redirect, you can configure the outputs of this
Expand Down
2 changes: 2 additions & 0 deletions modules/setting/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ func newAccessLogService() {

func newRouterLogService() {
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 {
options := newDefaultLogOptions()
Expand Down