summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorIgor Drozdov <idrozdov@gitlab.com>2021-09-28 19:08:34 +0000
committerIgor Drozdov <idrozdov@gitlab.com>2021-09-28 19:08:34 +0000
commit6d146c217dc1ba78aa4a0c47c59b5b2e7be774d9 (patch)
tree0d70e3e65b0192089d6dd04b0ac8120341ba7de8 /README.md
parenta1ae9e5ad2900d512a58ce64f4ad0f02769c3edd (diff)
parentf40ddda89781aeb156f9b36bdb7d733c55b363c0 (diff)
downloadgitlab-shell-6d146c217dc1ba78aa4a0c47c59b5b2e7be774d9.tar.gz
Merge branch '499-log-me-more' into 'main'
Add more logging to gitlab-sshd See merge request gitlab-org/gitlab-shell!531
Diffstat (limited to 'README.md')
-rw-r--r--README.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/README.md b/README.md
index 7847377..a45b30d 100644
--- a/README.md
+++ b/README.md
@@ -98,6 +98,21 @@ environment.
Starting with GitLab 8.12, GitLab supports Git LFS authentication through SSH.
+## Logging Guidelines
+
+In general, it should be possible to determine the structure, but not content,
+of a gitlab-shell or gitlab-sshd session just from inspecting the logs. Some
+guidelines:
+
+- We use [`gitlab.com/gitlab-org/labkit/log`](https://pkg.go.dev/gitlab.com/gitlab-org/labkit/log)
+ for logging functionality
+- **Always** include a correlation ID
+- Log messages should be invariant and unique. Include accessory information in
+ fields, using `log.WithField`, `log.WithFields`, or `log.WithError`.
+- Log success cases as well as error cases
+- Logging too much is better than not logging enough. If a message seems too
+ verbose, consider reducing the log level before removing the message.
+
## Releasing
See [PROCESS.md](./PROCESS.md)