From 3b6b580654615da3ed656a9ca32d87f77b061543 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Tue, 17 Jun 2014 09:41:06 +0200 Subject: [PATCH] Add documentation for Runit logging --- CHANGELOG | 1 + README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 0 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 03cb82f..c7f0685 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -17,6 +17,7 @@ omnibus-gitlab repository. - Include Python and docutils for reStructuredText support - Update Ruby to version 2.1.1 - Update Git to version 2.0.0 +- Make Runit log rotation configurable 6.9.2 - Create the authorized-keys.lock file for gitlab-shell 1.9.4 diff --git a/README.md b/README.md index 8c0e84e..f758eb1 100644 --- a/README.md +++ b/README.md @@ -455,6 +455,45 @@ Omnibus-gitlab uses four different directories. - `/var/log/gitlab` contains all log data generated by components of omnibus-gitlab. +## Logs + +### Tail logs in a console on the server + +If you want to 'tail', i.e. view live log updates of GitLab logs you can use +`gitlab-ctl tail`. + +```shell +# Tail all logs; press Ctrl-C to exit +sudo gitlab-ctl tail + +# Drill down to a sub-directory of /var/log/gitlab +sudo gitlab-ctl tail gitlab-rails + +# Drill down to an individual file +sudo gitlab-ctl tail nginx/gitlab_error.log +``` + +### Runit logs + +The Runit-managed services in omnibus-gitlab generate log data using +[svlogd][svlogd]. See the [svlogd documentation][svlogd] for more information +about the files it generates. + +You can modify svlogd settings via `/etc/gitlab/gitlab.rb` with the following settings: + +```ruby +# Below are the default values +logging['svlogd_size'] = 200 * 1024 * 1024 # rotate after 200 MB of log data +logging['svlogd_num'] = 30 # keep 30 rotated log files +logging['svlogd_timeout'] = 24 * 60 * 60 # rotate after 24 hours +logging['svlogd_filter'] = "gzip" # compress logs with gzip +logging['svlogd_udp'] = nil # transmit log messages via UDP +logging['svlogd_prefix'] = nil # custom prefix for log messages + +# Optionally, you can override the prefix for e.g. Nginx +nginx['svlogd_prefix'] = "nginx" +``` + ## Starting a Rails console session If you need access to a Rails production console for your GitLab installation @@ -543,3 +582,4 @@ This omnibus installer project is based on the awesome work done by Chef in [database.yml.postgresql]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/database.yml.postgresql [database.yml.mysql]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/database.yml.mysql [gitlab.yml.example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/gitlab.yml.example +[svlogd]: http://smarden.org/runit/svlogd.8.html -- libgit2 0.21.2