Commit 07ddbbb4 authored by Stan Hu's avatar Stan Hu

Add docs on structured logging in GitLab

[ci skip]
parent acd270ae
......@@ -9,6 +9,33 @@ documentation](
System log files are typically plain text in a standard log file format.
This guide talks about how to read and use these system log files.
## `production_json.log`
This file lives in `/var/log/gitlab/gitlab-rails/production_json.log` for
Omnibus GitLab packages or in `/home/git/gitlab/log/production_json.log` for
installations from source. (When Gitlab is running in an environment
other than production, the corresponding logfile is shown here.)
It contains a structured log for Rails controller requests received from
GitLab, thanks to [Lograge]( Note that
requests from the API [are not yet logged to this
Each line contains a JSON line that can be ingested by Elasticsearch, Splunk, etc. For example:
In this example, you can see this was a GET request for a specific issue. Notice each line also contains performance data:
1. `duration`: the total time taken to retrieve the request
2. `view`: total time taken inside the Rails views
3. `db`: total time to retrieve data from the database
In addition, the log contains the IP address from which the request originated
(`remote_ip`) as well as the user's ID (`user_id`), and username (`username`).
## `production.log`
This file lives in `/var/log/gitlab/gitlab-rails/production.log` for
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment