From b511f70670b118497e6daf974796da704eabe008 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Wed, 7 Sep 2022 15:00:20 +0800 Subject: [PATCH 1/2] Upgrade the document about how to collect logs for systemd and docker --- .../doc/advanced/logging-documentation.en-us.md | 6 ++++-- docs/content/doc/help/faq.en-us.md | 10 ++++------ docs/content/doc/help/seek-help.en-us.md | 6 ++++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/docs/content/doc/advanced/logging-documentation.en-us.md b/docs/content/doc/advanced/logging-documentation.en-us.md index b519641591ea5..4e8cbb32825d0 100644 --- a/docs/content/doc/advanced/logging-documentation.en-us.md +++ b/docs/content/doc/advanced/logging-documentation.en-us.md @@ -15,12 +15,14 @@ menu: # Logging Configuration -The logging framework has been revamped in Gitea 1.9.0. - **Table of Contents** {{< toc >}} +## Collecting Logs for Help + +To collect logs for help and issue report, see [Support Options]({{< relref "doc/help/seek-help.en-us.md" >}}). + ## Log Groups The fundamental thing to be aware of in Gitea is that there are several diff --git a/docs/content/doc/help/faq.en-us.md b/docs/content/doc/help/faq.en-us.md index 17983da695389..c3f37e36dc5fc 100644 --- a/docs/content/doc/help/faq.en-us.md +++ b/docs/content/doc/help/faq.en-us.md @@ -120,10 +120,6 @@ In Gitea, an "active" user refers to a user that has activated their account via A "login prohibited" user is a user that is not allowed to log in to Gitea anymore -## Setting up logging - -- [Official Docs]({{< relref "doc/advanced/logging-documentation.en-us.md" >}}) - ## What is Swagger? [Swagger](https://swagger.io/) is what Gitea uses for its API. @@ -392,7 +388,9 @@ Gitea requires the system or browser to have one of the supported Emoji fonts in Stdout on systemd goes to the journal by default. Try using `journalctl`, `journalctl -u gitea`, or `journalctl `. -Similarly stdout on docker can be viewed using `docker logs ` +Similarly, stdout on docker can be viewed using `docker logs `. + +To collect logs for help and issue report, see [Support Options]({{< relref "doc/help/seek-help.en-us.md" >}}). ## Initial logging @@ -413,7 +411,7 @@ unchanged in the database schema. This may lead to warning such as: 2020/08/02 11:32:29 ...rm/session_schema.go:360:Sync2() [W] Table user Column keep_activity_private db default is , struct default is 0 ``` -These can safely be ignored but you may able to stop these warnings by getting Gitea to recreate these tables using: +These can safely be ignored, but you are able to stop these warnings by getting Gitea to recreate these tables using: ``` gitea doctor recreate-table user diff --git a/docs/content/doc/help/seek-help.en-us.md b/docs/content/doc/help/seek-help.en-us.md index fe898e34b90d9..fe47481600a65 100644 --- a/docs/content/doc/help/seek-help.en-us.md +++ b/docs/content/doc/help/seek-help.en-us.md @@ -22,12 +22,14 @@ menu: 1. Your `app.ini` (with any sensitive data scrubbed as necessary). 2. The Gitea logs, and any other appropriate log files for the situation. - - The logs are likely to be outputted to console. If you need to collect logs from files, + - When using systemd, use `journalctl --lines 1000 --unit gitea` to collect logs. + - When using docker, use `docker logs --tail 1000 ` to collect logs. + - By default, the logs are outputted to console. If you need to collect logs from files, you could copy the following config into your `app.ini` (remove all other `[log]` sections), then you can find the `*.log` files in Gitea's log directory (default: `%(GITEA_WORK_DIR)/log`). ```ini - ; To show all SQL logs, you can also set LOG_SQL=true in the [database] section + ; To show all SQL logs, you can also set LOG_SQL=true in the [database] section [log] LEVEL=debug MODE=console,file From 70fe5a1534d92b495df2255acbb82b958df963c1 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Wed, 7 Sep 2022 18:30:49 +0800 Subject: [PATCH 2/2] Update faq.en-us.md --- docs/content/doc/help/faq.en-us.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/content/doc/help/faq.en-us.md b/docs/content/doc/help/faq.en-us.md index c3f37e36dc5fc..970a6866a6b5f 100644 --- a/docs/content/doc/help/faq.en-us.md +++ b/docs/content/doc/help/faq.en-us.md @@ -120,6 +120,10 @@ In Gitea, an "active" user refers to a user that has activated their account via A "login prohibited" user is a user that is not allowed to log in to Gitea anymore +## Setting up logging + +- [Official Docs]({{< relref "doc/advanced/logging-documentation.en-us.md" >}}) + ## What is Swagger? [Swagger](https://swagger.io/) is what Gitea uses for its API.