From c5b08f6d5a73e6ba84da84e804d05a8dd3d651be Mon Sep 17 00:00:00 2001 From: zeripath Date: Mon, 6 Jul 2020 01:07:07 +0100 Subject: Pause, Resume, Release&Reopen, Add and Remove Logging from command line (#11777) * Make LogDescriptions race safe * Add manager commands for pausing, resuming, adding and removing loggers Signed-off-by: Andrew Thornton * Placate lint * Ensure that file logger is run! * Add support for smtp and conn Signed-off-by: Andrew Thornton * Add release-and-reopen Signed-off-by: Andrew Thornton Co-authored-by: techknowlogick Co-authored-by: Lauris BH --- .../doc/advanced/logging-documentation.en-us.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'docs/content/doc/advanced') diff --git a/docs/content/doc/advanced/logging-documentation.en-us.md b/docs/content/doc/advanced/logging-documentation.en-us.md index 919ccf783b..f3880be7c4 100644 --- a/docs/content/doc/advanced/logging-documentation.en-us.md +++ b/docs/content/doc/advanced/logging-documentation.en-us.md @@ -316,6 +316,28 @@ COLORIZE = true # Or false if your windows terminal cannot color This is equivalent to sending all logs to the console, with default go log being sent to the console log too. +## Releasing-and-Reopening, Pausing and Resuming logging + +If you are running on Unix you may wish to release-and-reopen logs in order to use `logrotate` or other tools. +It is possible force gitea to release and reopen it's logging files and connections by sending `SIGUSR1` to the +running process, or running `gitea manager logging release-and-reopen`. + +Alternatively, you may wish to pause and resume logging - this can be accomplished through the use of the +`gitea manager logging pause` and `gitea manager logging resume` commands. Please note that whilst logging +is paused log events below INFO level will not be stored and only a limited number of events will be stored. +Logging may block, albeit temporarily, slowing gitea considerably whilst paused - therefore it is +recommended that pausing only done for a very short period of time. + +## Adding and removing logging whilst Gitea is running + +It is possible to add and remove logging whilst Gitea is running using the `gitea manager logging add` and `remove` subcommands. +This functionality can only adjust running log systems and cannot be used to start the access, macaron or router loggers if they +were not already initialised. If you wish to start these systems you are advised to adjust the app.ini and (gracefully) restart +the Gitea service. + +The main intention of these commands is to easily add a temporary logger to investigate problems on running systems where a restart +may cause the issue to disappear. + ## Log colorization Logs to the console will be colorized by default when not running on -- cgit v1.2.3