Commit 7638a741 authored by Dylan Griffith's avatar Dylan Griffith

Create dedicated log file for Elasticsearch integration

Dedicated log files for different parts of the system will help us and
our users debugging parts of the system that obviously relate to this
feature.

In future we should add even more logging to this file especially around
indexing events and any exceptions we're catching in sidekiq or web.
parent c06a4353
......@@ -393,6 +393,23 @@ It is stored at:
- `/var/log/gitlab/gitlab-rails/database_load_balancing.log` for Omnibus GitLab packages.
- `/home/git/gitlab/log/database_load_balancing.log` for installations from source.
## `elasticsearch.log`
Introduced in GitLab 12.6. This file lives in
`/var/log/gitlab/gitlab-rails/elasticsearch.log` for Omnibus GitLab
packages or in `/home/git/gitlab/log/elasticsearch.log` for installations
from source.
It logs information related to the Elasticsearch Integration including
errors during indexing or searching Elasticsearch.
Each line contains a JSON line that can be ingested by Elasticsearch, Splunk,
etc. For example:
```json
{"severity":"DEBUG","time":"2019-10-17T06:23:13.227Z","correlation_id":null,"message":"redacted_search_result","class_name":"Milestone","id":2,"ability":"read_milestone","current_user_id":2,"query":"project"}
```
[repocheck]: repository_checks.md
[Rack Attack]: ../security/rack_attack.md
[Rate Limit]: ../user/admin_area/settings/rate_limits_on_raw_endpoints.md
......
......@@ -52,7 +52,7 @@ module EE
private
def logger
@logger ||= ::Gitlab::ProjectServiceLogger.build
@logger ||= ::Gitlab::Elasticsearch::Logger.build
end
end
end
# frozen_string_literal: true
module Gitlab
module Elasticsearch
class Logger < ::Gitlab::JsonLogger
def self.file_name_noext
'elasticsearch'
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment