production_json.log
production.log
api_json.log
application.log
application_json.log
integrations_json.log
kubernetes.log
git_json.log
audit_json.log
- Sidekiqログ
-
gitlab-shell.log
- Gitalyログ
- プーマ・ログ
- ユニコーンの丸太
repocheck.log
importer.log
exporter.log
auth.log
graphql_json.log
migrations.log
mail_room_json.log
(デフォルト)- ログの再構成
sidekiq_exporter.log
とweb_exporter.log
database_load_balancing.log
elasticsearch.log
exceptions_json.log
service_measurement.log
geo.log
- レジストリログ
- Nginxログ
- ページ ログ
- マターモスト・ログ
- ワークホース丸太
- PostgreSQL ログ
- プロメテウス・ログ
- Redisログ
- アラートマネージャーのログ
- クロンログ
- Grafana ログ
- ログ回転ログ
- GitLab モニターログ
- GitLab Exporter
ログシステム
GitLabはすべてのログが記録される高度なログシステムを持っているので、様々なシステムログファイルを使ってインスタンスを分析することができます。 システムログファイルに加えて、GitLab Enterprise EditionはAudit Eventsを提供しています。 それらについて詳しくはAudit Eventsのドキュメントをご覧ください。
このガイドでは、システム・ログ・ファイルの読み方と使い方について説明します。
production_json.log
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/gitlab-rails/production_json.log
、ソースからのインストールの場合は/home/git/gitlab/log/production_json.log
。GitLabがproduction以外の環境で動いている場合は、対応するログファイルがここに表示されます。
Logrageのおかげで、GitLabから受け取ったRailsコントローラのリクエストの構造化されたログが含まれています。 APIからのリクエストは、api_json.log
の別のファイルに記録されることに注意してください。
各行には、ElasticsearchやSplunkのようなサービスで取り込むことができるJSON行が含まれています。 見やすいように、例には改行が加えられています:
{
"method":"GET",
"path":"/gitlab/gitlab-foss/issues/1234",
"format":"html",
"controller":"Projects::IssuesController",
"action":"show",
"status":200,
"time":"2017-08-08T20:15:54.821Z",
"params":[{"key":"param_key","value":"param_value"}],
"remote_ip":"18.245.0.1",
"user_id":1,
"username":"admin",
"queue_duration_s":0.0,
"gitaly_calls":16,
"gitaly_duration_s":0.16,
"redis_calls":115,
"redis_duration_s":0.13,
"redis_read_bytes":1507378,
"redis_write_bytes":2920,
"correlation_id":"O1SdybnnIq7",
"cpu_s":17.50,
"db_duration_s":0.08,
"view_duration_s":2.39,
"duration_s":20.54
}
この例は特定のイシューに対するGETリクエストです。 各行には秒単位のパフォーマンス・データも含まれています:
-
duration_s
リクエストの取得にかかった合計時間 -
queue_duration_s
GitLab Workhorse内でリクエストがキューに入れられた合計時間。 -
view_duration_s
: Railsビューの内部でかかった時間の合計 -
db_duration_s
PostgreSQL からのデータ取得にかかる合計時間 -
cpu_s
CPUの総使用時間 -
gitaly_duration_s
Gitaly呼び出しにかかる合計時間。 -
gitaly_calls
:Gitalyにかけられた通話の総数 -
redis_calls
Redisへの総コール数 -
redis_duration_s
Redisからデータを取得する合計時間 -
redis_read_bytes
Redis から読み込んだ合計バイト数 -
redis_write_bytes
Redis に書き込まれた合計バイト数 -
redis_<instance>_calls
Redis インスタンスへのコール総数 -
redis_<instance>_duration_s
Redis インスタンスからデータを取得するための合計時間 -
redis_<instance>_read_bytes
Redis インスタンスから読み込んだ合計バイト数 -
redis_<instance>_write_bytes
Redis インスタンスに書き込まれた合計バイト数
HTTPトランスポートを使用したユーザークローンとフェッチのアクティビティは、このログにaction: git_upload_pack
として表示されます。
さらに、ログには発信元IPアドレス(remote_ip
)、ユーザーID(user_id
)、ユーザー名(username
)が含まれます。
Advanced Global Searchを使用している場合、/search
のようないくつかのエンドポイントが Elasticsearch にリクエストを行うことがあります。これらはさらにelasticsearch_calls
とelasticsearch_call_duration_s
に対応するログを記録します:
-
elasticsearch_calls
Elasticsearch の総コール数 -
elasticsearch_duration_s
Elasticsearch の呼び出しにかかる合計時間
ActionCable接続とサブスクリプションイベントもこのファイルに記録され、上記と同じフォーマットに従います。method
、path
、format
フィールドは適用されず、常に空です。ActionCable接続またはチャネルクラスは、controller
として使用されます。
{
"method":{},
"path":{},
"format":{},
"controller":"IssuesChannel",
"action":"subscribe",
"status":200,
"time":"2020-05-14T19:46:22.008Z",
"params":[{"key":"project_path","value":"gitlab/gitlab-foss"},{"key":"iid","value":"1"}],
"remote_ip":"127.0.0.1",
"user_id":1,
"username":"admin",
"ua":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:76.0) Gecko/20100101 Firefox/76.0",
"correlation_id":"jSOIEynHCUa",
"duration_s":0.32566
}
class
,message
,backtrace
の代わりにexception
フィールドが含まれるようになりました。以前のバージョンでは、exception.class
とexception.message
の代わりにerror
フィールドが含まれていました。 例えば、 と の代わりに フィールドが含まれていました:{
"method": "GET",
"path": "/admin",
"format": "html",
"controller": "Admin::DashboardController",
"action": "index",
"status": 500,
"time": "2019-11-14T13:12:46.156Z",
"params": [],
"remote_ip": "127.0.0.1",
"user_id": 1,
"username": "root",
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:70.0) Gecko/20100101 Firefox/70.0",
"queue_duration": 274.35,
"correlation_id": "KjDVUhNvvV3",
"queue_duration_s":0.0,
"gitaly_calls":16,
"gitaly_duration_s":0.16,
"redis_calls":115,
"redis_duration_s":0.13,
"correlation_id":"O1SdybnnIq7",
"cpu_s":17.50,
"db_duration_s":0.08,
"view_duration_s":2.39,
"duration_s":20.54
"exception.class": "NameError",
"exception.message": "undefined local variable or method `adsf' for #<Admin::DashboardController:0x00007ff3c9648588>",
"exception.backtrace": [
"app/controllers/admin/dashboard_controller.rb:11:in `index'",
"ee/app/controllers/ee/admin/dashboard_controller.rb:14:in `index'",
"ee/lib/gitlab/ip_address_state.rb:10:in `with'",
"ee/app/controllers/ee/application_controller.rb:43:in `set_current_ip_address'",
"lib/gitlab/session.rb:11:in `with_session'",
"app/controllers/application_controller.rb:450:in `set_session_storage'",
"app/controllers/application_controller.rb:444:in `set_locale'",
"ee/lib/gitlab/jira/middleware.rb:19:in `call'"
]
}
production.log
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/gitlab-rails/production.log
、ソースからのインストールの場合は/home/git/gitlab/log/production.log
。 (GitLabがproduction以外の環境で稼働している場合は、対応するログファイルがここに表示されます)。
このログファイルには、実行されたすべてのリクエストについての情報が含まれます。 リクエストの URL や種類、IP アドレス、そしてこの特定のリクエストに対応するためにコードのどの部分が関与したのかを見ることができます。 また、実行されたすべての SQL リクエストと、それぞれにかかった時間も見ることができます。 このタスクは、GitLab の貢献者や開発者にとってはより便利なものです。 バグを報告するときには、このログファイルの一部を使用します。 たとえば次のようなものです:
Started GET "/gitlabhq/yaml_db/tree/master" for 168.111.56.1 at 2015-02-12 19:34:53 +0200
Processing by Projects::TreeController#show as HTML
Parameters: {"project_id"=>"gitlabhq/yaml_db", "id"=>"master"}
... [CUT OUT]
Namespaces"."created_at" DESC, "namespaces"."id" DESC LIMIT 1 [["id", 26]]
CACHE (0.0ms) SELECT "members".* FROM "members" WHERE "members"."source_type" = 'Project' AND "members"."type" IN ('ProjectMember') AND "members"."source_id" = $1 AND "members"."source_type" = $2 AND "members"."user_id" = 1 ORDER BY "members"."created_at" DESC, "members"."id" DESC LIMIT 1 [["source_id", 18], ["source_type", "Project"]]
CACHE (0.0ms) SELECT "members".* FROM "members" WHERE "members"."source_type" = 'Project' AND "members".
(1.4ms) SELECT COUNT(*) FROM "merge_requests" WHERE "merge_requests"."target_project_id" = $1 AND ("merge_requests"."state" IN ('opened','reopened')) [["target_project_id", 18]]
Rendered layouts/nav/_project.html.haml (28.0ms)
Rendered layouts/_collapse_button.html.haml (0.2ms)
Rendered layouts/_flash.html.haml (0.1ms)
Rendered layouts/_page.html.haml (32.9ms)
Completed 200 OK in 166ms (Views: 117.4ms | ActiveRecord: 27.2ms)
この例では、サーバーはIP168.111.56.1
からURL/gitlabhq/yaml_db/tree/master
のHTTPリクエストを2015-02-12 19:34:53 +0200
で処理しました。 リクエストはProjects::TreeController
で処理されました。
api_json.log
GitLab 10.0で導入されました。
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/gitlab-rails/api_json.log
、ソースからインストールする場合は/home/git/gitlab/log/api_json.log
。
例えば、APIに直接送られたリクエストを確認するのに役立ちます:
{
"time":"2018-10-29T12:49:42.123Z",
"severity":"INFO",
"duration":709.08,
"db":14.59,
"view":694.49,
"status":200,
"method":"GET",
"path":"/api/v4/projects",
"params":[{"key":"action","value":"git-upload-pack"},{"key":"changes","value":"_any"},{"key":"key_id","value":"secret"},{"key":"secret_token","value":"[FILTERED]"}],
"host":"localhost",
"remote_ip":"::1",
"ua":"Ruby",
"route":"/api/:version/projects",
"user_id":1,
"username":"root",
"queue_duration":100.31,
"gitaly_calls":30,
"gitaly_duration":5.36
}
このエントリは、関連する SSH キーがgit fetch
あるいはgit clone
経由で該当するプロジェクトをダウンロードできるかどうかをチェックするためにアクセスされる内部エンドポイントを示しています:
-
duration
: リクエストの取得に要した合計時間(ミリ秒単位 -
queue_duration
: GitLab Workhorse内でリクエストがキューに入れられた合計時間(ミリ秒単位 -
method
リクエストに使用されたHTTPメソッド -
path
クエリの相対パス -
params
クエリ文字列またはHTTPボディで渡されるキーと値のペア。 機密性の高いパラメータ(パスワードやトークンなど)はフィルタリングされます。 -
ua
リクエスト元のユーザーエージェント。
application.log
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/gitlab-rails/application.log
、ソースからインストールする場合は/home/git/gitlab/log/application.log
。
ユーザーの作成、プロジェクトの削除など、インスタンスで起きているイベントを発見するのに役立ちます。 例えば、以下のようなことです:
October 06, 2014 11:56: User "Administrator" (admin@example.com) was created
October 06, 2014 11:56: Documentcloud created a new project "Documentcloud / Underscore"
October 06, 2014 11:56: Gitlab Org created a new project "Gitlab Org / Gitlab Ce"
October 07, 2014 11:25: User "Claudie Hodkiewicz" (nasir_stehr@olson.co.uk) was removed
October 07, 2014 11:25: Project "project133" was removed
application_json.log
GitLab 12.7から導入されました。
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/gitlab-rails/application_json.log
、ソースからインストールする場合は/home/git/gitlab/log/application_json.log
。
以下の例のように、application.log
のログのJSONバージョンがコンテナに入っています:
{
"severity":"INFO",
"time":"2020-01-14T13:35:15.466Z",
"correlation_id":"3823a1550b64417f9c9ed8ee0f48087e",
"message":"User \"Administrator\" (admin@example.com) was created"
}
{
"severity":"INFO",
"time":"2020-01-14T13:35:15.466Z",
"correlation_id":"78e3df10c9a18745243d524540bd5be4",
"message":"Project \"project133\" was removed"
}
integrations_json.log
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/gitlab-rails/integrations_json.log
、ソースからインストールする場合は/home/git/gitlab/log/integrations_json.log
。
このコンテナには、Jira、Asana、Irker サービスなどのインテグレーションアクティビティに関する情報が含まれています。 以下の例のように JSON フォーマットを使用します:
{
"severity":"ERROR",
"time":"2018-09-06T14:56:20.439Z",
"service_class":"JiraService",
"project_id":8,
"project_path":"h5bp/html5-boilerplate",
"message":"Error sending message",
"client_url":"http://jira.gitlap.com:8080",
"error":"execution expired"
}
{
"severity":"INFO",
"time":"2018-09-06T17:15:16.365Z",
"service_class":"JiraService",
"project_id":3,
"project_path":"namespace2/project2",
"message":"Successfully posted",
"client_url":"http://jira.example.com"
}
kubernetes.log
GitLab 11.6で導入されました。
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/gitlab-rails/kubernetes.log
、ソースからインストールする場合は/home/git/gitlab/log/kubernetes.log
。
管理対象のKubernetesクラスタにクラスタアプリケーションをインストールする際のエラーなど、Kubernetesインテグレーションに関連する情報をログに記録します。
各行には、Elasticsearch や Splunk などのサービスで取り込むことができる JSON 行が含まれています。 以下の例では、わかりやすくするために改行を追加しています:
{
"severity":"ERROR",
"time":"2018-11-23T15:14:54.652Z",
"exception":"Kubeclient::HttpError",
"error_code":401,
"service":"Clusters::Applications::CheckInstallationProgressService",
"app_id":14,
"project_ids":[1],
"group_ids":[],
"message":"Unauthorized"
}
{
"severity":"ERROR",
"time":"2018-11-23T15:42:11.647Z",
"exception":"Kubeclient::HttpError",
"error_code":null,
"service":"Clusters::Applications::InstallService",
"app_id":2,
"project_ids":[19],
"group_ids":[],
"message":"SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate)"
}
git_json.log
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/gitlab-rails/git_json.log
、ソースからインストールする場合は/home/git/gitlab/log/git_json.log
。
githost.log
からgit_json.log
に名前が変更され、JSON形式で保存されるようになりました。GitLabはGitリポジトリとやり取りをしなければなりませんが、まれに何か問題が発生することがあり、このような場合に何が起こったのかを正確に知る必要があるかもしれません。 このログファイルには、GitLabからGitリポジトリへの失敗したリクエストがすべて記録されています。 ほとんどの場合、このファイルは開発者のみに役立ちます。 例えば、以下のような場合です:
{
"severity":"ERROR",
"time":"2019-07-19T22:16:12.528Z",
"correlation_id":"FeGxww5Hj64",
"message":"Command failed [1]: /usr/bin/git --git-dir=/Users/vsizov/gitlab-development-kit/gitlab/tmp/tests/gitlab-satellites/group184/gitlabhq/.git --work-tree=/Users/vsizov/gitlab-development-kit/gitlab/tmp/tests/gitlab-satellites/group184/gitlabhq merge --no-ff -mMerge branch 'feature_conflict' into 'feature' source/feature_conflict\n\nerror: failed to push some refs to '/Users/vsizov/gitlab-development-kit/repositories/gitlabhq/gitlab_git.git'"
}
audit_json.log
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/gitlab-rails/audit_json.log
、ソースからインストールする場合は/home/git/gitlab/log/audit_json.log
。
グループやプロジェクト設定の変更は、このファイルに記録されます。 たとえば、以下のような場合です:
{
"severity":"INFO",
"time":"2018-10-17T17:38:22.523Z",
"author_id":3,
"entity_id":2,
"entity_type":"Project",
"change":"visibility",
"from":"Private",
"to":"Public",
"author_name":"John Doe4",
"target_id":2,
"target_type":"Project",
"target_details":"namespace2/project2"
}
Sidekiqログ
Omnibusインストールの場合、Sidekiqログの一部は/var/log/gitlab/sidekiq/current
、次のように保存されます。
sidekiq.log
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/gitlab-rails/sidekiq.log
、ソースからインストールする場合は/home/git/gitlab/log/sidekiq.log
。
GitLabは、時間がかかるタスクの処理にバックグラウンドジョブを使用します。 これらのジョブの処理に関するすべての情報は、このファイルに書き出されます。 例えば、次のようになります:
2014-06-10T07:55:20Z 2037 TID-tm504 ERROR: /opt/bitnami/apps/discourse/htdocs/vendor/bundle/ruby/1.9.1/gems/redis-3.0.7/lib/redis/client.rb:228:in `read'
2014-06-10T18:18:26Z 14299 TID-55uqo INFO: Booting Sidekiq 3.0.0 with redis options {:url=>"redis://localhost:6379/0", :namespace=>"sidekiq"}
上記の形式の代わりに、Sidekiq用のJSONログを生成することもできます。 たとえば、以下のようになります:
{
"severity":"INFO",
"time":"2018-04-03T22:57:22.071Z",
"queue":"cronjob:update_all_mirrors",
"args":[],
"class":"UpdateAllMirrorsWorker",
"retry":false,
"queue_namespace":"cronjob",
"jid":"06aeaa3b0aadacf9981f368e",
"created_at":"2018-04-03T22:57:21.930Z",
"enqueued_at":"2018-04-03T22:57:21.931Z",
"pid":10077,
"message":"UpdateAllMirrorsWorker JID-06aeaa3b0aadacf9981f368e: done: 0.139 sec",
"job_status":"done",
"duration":0.139,
"completed_at":"2018-04-03T22:57:22.071Z",
"db_duration":0.05,
"db_duration_s":0.0005,
"gitaly_duration":0,
"gitaly_calls":0
}
Omnibus GitLabをインストールする場合は、設定オプションを追加します:
sidekiq['log_format'] = 'json'
ソースインストールでは、gitlab.yml
を編集し、Sidekiqlog_format
設定オプションを設定します:
## Sidekiq
sidekiq:
log_format: json
sidekiq_client.log
GitLab 12.9で導入されました。
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/gitlab-rails/sidekiq_client.log
、ソースからインストールする場合は/home/git/gitlab/log/sidekiq_client.log
。
このファイルには、Sidekiqが処理を開始する前、たとえばキューに入れられる前のジョブに関するログ情報が含まれています。
このログファイルは、sidekiq.log
と同じ構造に従っているため、前述のようにSidekiq用に設定した場合はJSONとして構造化されます。
gitlab-shell.log
GitLab ShellはGitLabでGitコマンドの実行に使用され、GitリポジトリへのSSHアクセスを提供します。
GitLab バージョン 12.10 以上の場合
GitLab バージョン 12.10 以降では、gitlab-shell.log
ファイルが 2 つあります。git-{upload-pack,receive-pack}
リクエストを含む情報は/var/log/gitlab/gitlab-shell/gitlab-shell.log
にあります。Gitaly からの GitLab Shell へのフックに関する情報は/var/log/gitlab/gitaly/gitlab-shell.log
にあります。
/var/log/gitlab/gitlab-shell/gitlab-shell.log
のログエントリー例:
{
"duration_ms": 74.104,
"level": "info",
"method": "POST",
"msg": "Finished HTTP request",
"time": "2020-04-17T20:28:46Z",
"url": "http://127.0.0.1:8080/api/v4/internal/allowed"
}
{
"command": "git-upload-pack",
"git_protocol": "",
"gl_project_path": "root/example",
"gl_repository": "project-1",
"level": "info",
"msg": "executing git command",
"time": "2020-04-17T20:28:46Z",
"user_id": "user-1",
"username": "root"
}
/var/log/gitlab/gitaly/gitlab-shell.log
のログエントリー例:
{
"method": "POST",
"url": "http://127.0.0.1:8080/api/v4/internal/allowed",
"duration": 0.058012959,
"gitaly_embedded": true,
"pid": 16636,
"level": "info",
"msg": "finished HTTP request",
"time": "2020-04-17T20:29:08+00:00"
}
{
"method": "POST",
"url": "http://127.0.0.1:8080/api/v4/internal/pre_receive",
"duration": 0.031022552,
"gitaly_embedded": true,
"pid": 16636,
"level": "info",
"msg": "finished HTTP request",
"time": "2020-04-17T20:29:08+00:00"
}
GitLab バージョン 12.5 から 12.9 の場合
GitLab 12.5から12.9では、このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/gitaly/gitlab-shell.log
、ソースからのインストールの場合は/home/git/gitaly/gitlab-shell.log
。
ログエントリの例:
{
"method": "POST",
"url": "http://127.0.0.1:8080/api/v4/internal/post_receive",
"duration": 0.031809164,
"gitaly_embedded": true,
"pid": 27056,
"level": "info",
"msg": "finished HTTP request",
"time": "2020-04-17T16:24:38+00:00"
}
GitLab 12.5以前の場合
GitLab 12.5以前では、ファイルは/var/log/gitlab/gitlab-shell/gitlab-shell.log
にあります。
ログエントリの例:
I, [2015-02-13T06:17:00.671315 #9291] INFO -- : Adding project root/example.git at </var/opt/gitlab/git-data/repositories/root/dcdcdcdcd.git>.
I, [2015-02-13T06:17:00.679433 #9291] INFO -- : Moving existing hooks directory and symlinking global hooks directory for /var/opt/gitlab/git-data/repositories/root/example.git.
SSHトランスポートを使用したユーザークローン/フェッチのアクティビティは、このログにexecuting git command <gitaly-upload-pack...
として表示されます。
Gitalyログ
このファイルは/var/log/gitlab/gitaly/current
にあり、runitによって生成されます。runit
はOmnibus GitLabに同梱されており、その目的についての簡単な説明はOmnibus GitLabのドキュメントにあります。ログファイルはローテーションされ、Unixタイムスタンプ形式でリネームされ、gzip
-圧縮されます(@1584057562.s
のように)。
grpc.log
このファイルはOmnibus GitLabパッケージの/var/log/gitlab/gitlab-rails/grpc.log
。 Gitalyが使用するネイティブgRPCロギング。
プーマ・ログ
puma_stdout.log
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/puma/puma_stdout.log
、ソースからインストールする場合は/home/git/gitlab/log/puma_stdout.log
。
puma_stderr.log
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/puma/puma_stderr.log
、ソースからインストールする場合は/home/git/gitlab/log/puma_stderr.log
。
ユニコーンの丸太
unicorn_stdout.log
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/unicorn/unicorn_stdout.log
、ソースからインストールする場合は/home/git/gitlab/log/unicorn_stdout.log
。
unicorn_stderr.log
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/unicorn/unicorn_stderr.log
、ソースからインストールする場合は/home/git/gitlab/log/unicorn_stderr.log
。
これらのログには、任意の時点での Unicorn プロセスの状態に関するすべての情報がコンテナで記録されています。
I, [2015-02-13T06:14:46.680381 #9047] INFO -- : Refreshing Gem list
I, [2015-02-13T06:14:56.931002 #9047] INFO -- : listening on addr=127.0.0.1:8080 fd=12
I, [2015-02-13T06:14:56.931381 #9047] INFO -- : listening on addr=/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket fd=13
I, [2015-02-13T06:14:56.936638 #9047] INFO -- : master process ready
I, [2015-02-13T06:14:56.946504 #9092] INFO -- : worker=0 spawned pid=9092
I, [2015-02-13T06:14:56.946943 #9092] INFO -- : worker=0 ready
I, [2015-02-13T06:14:56.947892 #9094] INFO -- : worker=1 spawned pid=9094
I, [2015-02-13T06:14:56.948181 #9094] INFO -- : worker=1 ready
W, [2015-02-13T07:16:01.312916 #9094] WARN -- : #<Unicorn::HttpServer:0x0000000208f618>: worker (pid: 9094) exceeds memory limit (320626688 bytes > 247066940 bytes)
W, [2015-02-13T07:16:01.313000 #9094] WARN -- : Unicorn::WorkerKiller send SIGQUIT (pid: 9094) alive: 3621 sec (trial 1)
I, [2015-02-13T07:16:01.530733 #9047] INFO -- : reaped #<Process::Status: pid 9094 exit 0> worker=1
I, [2015-02-13T07:16:01.534501 #13379] INFO -- : worker=1 spawned pid=13379
I, [2015-02-13T07:16:01.534848 #13379] INFO -- : worker=1 ready
repocheck.log
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/gitlab-rails/repocheck.log
、ソースからインストールする場合は/home/git/gitlab/log/repocheck.log
。
プロジェクトでリポジトリチェックが実行されるたびに、情報をログに記録します。
importer.log
GitLab 11.3 で導入されました。
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/gitlab-rails/importer.log
、ソースからインストールする場合は/home/git/gitlab/log/importer.log
。
インポート処理の進行状況を記録します。
exporter.log
GitLab 13.1 で導入されました。
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/gitlab-rails/exporter.log
、ソースからインストールする場合は/home/git/gitlab/log/exporter.log
。
エクスポートプロセスの進行状況を記録します。
auth.log
GitLab 12.0で導入されました。
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/gitlab-rails/auth.log
、ソースからインストールする場合は/home/git/gitlab/log/auth.log
。
このログには
graphql_json.log
GitLab 12.0から導入されました。
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/gitlab-rails/graphql_json.log
、ソースからインストールする場合は/home/git/gitlab/log/graphql_json.log
。
例えば、GraphQLクエリはそのファイルに記録されます:
{"query_string":"query IntrospectionQuery{__schema {queryType { name },mutationType { name }}}...(etc)","variables":{"a":1,"b":2},"complexity":181,"depth":1,"duration_s":7}
migrations.log
GitLab 12.3で導入されました。
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/gitlab-rails/migrations.log
、ソースからインストールする場合は/home/git/gitlab/log/migrations.log
。
mail_room_json.log
(デフォルト)
GitLab 12.6 で導入されました。
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/mailroom/current
、ソースからインストールする場合は/home/git/gitlab/log/mail_room_json.log
。
この構造化ログファイルは、mail_room
gemの内部アクティビティを記録します。名前とパスは設定可能なので、上記と一致しない場合があります。
ログの再構成
OmnibusのGitLabパッケージの/var/log/gitlab/reconfigure
。ソースからのインストールには、再設定ログはありません。gitlab-ctl reconfigure
。手動で、またはアップグレードの一部として実行されるたびに、再設定ログが入力されます。
再構成ログファイルは、再構成が開始されたUNIXタイムスタンプに従って、次のように命名されます。1509705644.log
sidekiq_exporter.log
と web_exporter.log
PrometheusメトリクスとSidekiq Exporterの両方が有効な場合、SidekiqはWebサーバーを起動し、定義されたポートをリッスンします(デフォルト:8082
)。アクセスログは、Omnibus GitLabパッケージの場合は/var/log/gitlab/gitlab-rails/sidekiq_exporter.log
、ソースからのインストールの場合は/home/git/gitlab/log/sidekiq_exporter.log
。
PrometheusメトリクスとWeb Exporterの両方が有効な場合、Puma/UnicornはWebサーバーを起動し、定義されたポートをリッスンします(デフォルト:8083
)。アクセスログは、Omnibus GitLabパッケージの場合は/var/log/gitlab/gitlab-rails/web_exporter.log
、ソースからのインストールの場合は/home/git/gitlab/log/web_exporter.log
。
database_load_balancing.log
GitLab 12.3 で導入されました。
GitLabのデータベースロードバランシングの詳細がコンテナに格納されています:
-
/var/log/gitlab/gitlab-rails/database_load_balancing.log
Omnibus GitLab パッケージ用です。 -
/home/git/gitlab/log/database_load_balancing.log
ソースからのインストール用。
elasticsearch.log
GitLab 12.6で導入されました。
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/gitlab-rails/elasticsearch.log
、ソースからインストールする場合は/home/git/gitlab/log/elasticsearch.log
。
Elasticsearch のインデックス作成や検索時のエラーなど、Elasticsearch インテグレーションに関連する情報をログに記録します。
各行には、Elasticsearch や Splunk などのサービスで取り込むことができる 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"
}
exceptions_json.log
GitLab 12.6 で導入されました。
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/gitlab-rails/exceptions_json.log
、ソースからインストールする場合は/home/git/gitlab/log/exceptions_json.log
。
これは、Gitlab::ErrorTracking
によって追跡されている例外に関する情報をログに記録し、救済された例外を処理する標準的で一貫性のある方法を提供します。
各行には、Elasticsearchが取り込むことができるJSON行が含まれています。 例えば、以下のようになります:
{
"severity": "ERROR",
"time": "2019-12-17T11:49:29.485Z",
"correlation_id": "AbDVUrrTvM1",
"extra.project_id": 55,
"extra.relation_key": "milestones",
"extra.relation_index": 1,
"exception.class": "NoMethodError",
"exception.message": "undefined method `strong_memoize' for #<Gitlab::ImportExport::RelationFactory:0x00007fb5d917c4b0>",
"exception.backtrace": [
"lib/gitlab/import_export/relation_factory.rb:329:in `unique_relation?'",
"lib/gitlab/import_export/relation_factory.rb:345:in `find_or_create_object!'"
]
}
service_measurement.log
GitLab 13.0で導入されました。
このファイルはOmnibus GitLabパッケージの場合は/var/log/gitlab/gitlab-rails/service_measurement.log
、ソースからインストールする場合は/home/git/gitlab/log/service_measurement.log
。
各サービス実行の計測値を含む単一の構造化ログのみが含まれます。SQL 呼び出し回数、execution_time
、gc_stats
、memory usage
などの計測値が含まれます。
使用例:
{ "severity":"INFO", "time":"2020-04-22T16:04:50.691Z","correlation_id":"04f1366e-57a1-45b8-88c1-b00b23dc3616","class":"Projects::ImportExport::ExportService","current_user":"John Doe","project_full_path":"group1/test-export","file_path":"/path/to/archive","gc_stats":{"count":{"before":127,"after":127,"diff":0},"heap_allocated_pages":{"before":10369,"after":10369,"diff":0},"heap_sorted_length":{"before":10369,"after":10369,"diff":0},"heap_allocatable_pages":{"before":0,"after":0,"diff":0},"heap_available_slots":{"before":4226409,"after":4226409,"diff":0},"heap_live_slots":{"before":2542709,"after":2641420,"diff":98711},"heap_free_slots":{"before":1683700,"after":1584989,"diff":-98711},"heap_final_slots":{"before":0,"after":0,"diff":0},"heap_marked_slots":{"before":2542704,"after":2542704,"diff":0},"heap_eden_pages":{"before":10369,"after":10369,"diff":0},"heap_tomb_pages":{"before":0,"after":0,"diff":0},"total_allocated_pages":{"before":10369,"after":10369,"diff":0},"total_freed_pages":{"before":0,"after":0,"diff":0},"total_allocated_objects":{"before":24896308,"after":24995019,"diff":98711},"total_freed_objects":{"before":22353599,"after":22353599,"diff":0},"malloc_increase_bytes":{"before":140032,"after":6650240,"diff":6510208},"malloc_increase_bytes_limit":{"before":25804104,"after":25804104,"diff":0},"minor_gc_count":{"before":94,"after":94,"diff":0},"major_gc_count":{"before":33,"after":33,"diff":0},"remembered_wb_unprotected_objects":{"before":34284,"after":34284,"diff":0},"remembered_wb_unprotected_objects_limit":{"before":68568,"after":68568,"diff":0},"old_objects":{"before":2404725,"after":2404725,"diff":0},"old_objects_limit":{"before":4809450,"after":4809450,"diff":0},"oldmalloc_increase_bytes":{"before":140032,"after":6650240,"diff":6510208},"oldmalloc_increase_bytes_limit":{"before":68537556,"after":68537556,"diff":0}},"time_to_finish":0.12298400001600385,"number_of_sql_calls":70,"memory_usage":"0.0 MiB","label":"process_48616"}
geo.log
9.5で導入されました。
Geo は、構造化されたログメッセージをgeo.log
ファイルに保存します。Omnibus のインストールでは、このファイルは/var/log/gitlab/gitlab-rails/geo.log
にあります。
このファイルには、Geo がリポジトリとファイルの同期を試みたときの情報が含まれています。 ファイルの各行には、取り込むことができる個別の JSON エントリが含まれています。 たとえば、Elasticsearch や Splunk などです。
使用例:
{"severity":"INFO","time":"2017-08-06T05:40:16.104Z","message":"Repository update","project_id":1,"source":"repository","resync_repository":true,"resync_wiki":true,"class":"Gitlab::Geo::LogCursor::Daemon","cursor_delay_s":0.038}
このメッセージは、Geo がプロジェクト1
でリポジトリの更新が必要であることを検知したことを示しています。
レジストリログ
Omnibus インストールの場合、コンテナレジストリログは/var/log/gitlab/registry/current
にあります。
Nginxログ
Omnibus インストールの場合、Nginx ログが存在します:
-
/var/log/gitlab/nginx/gitlab_access.log
GitLab へのリクエストのログがコンテナに入っています。 -
/var/log/gitlab/nginx/gitlab_error.log
には GitLab の Nginx エラーのログが含まれています。 -
/var/log/gitlab/nginx/gitlab_pages_access.log
Pages 静的サイトへのリクエストのログが含まれます。 -
/var/log/gitlab/nginx/gitlab_pages_error.log
Pages静的サイトのNginxエラーのログが含まれています。 -
/var/log/gitlab/nginx/gitlab_registry_access.log
にはコンテナレジストリへのリクエストのログが含まれます。 -
/var/log/gitlab/nginx/gitlab_registry_error.log
には、コンテナレジストリの Nginx エラーのログが含まれています。 -
/var/log/gitlab/nginx/gitlab_mattermost_access.log
には Mattermost へのリクエストのログが含まれます。 -
/var/log/gitlab/nginx/gitlab_mattermost_error.log
には Mattermost の Nginx エラーのログが含まれています。
下記はGitLab NGINXのデフォルトのアクセスログフォーマットです:
$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"
ページ ログ
Omnibusのインストールでは、Pagesのログは/var/log/gitlab/gitlab-pages/current
に保存されます。
使用例:
{
"level": "info",
"msg": "GitLab Pages Daemon",
"revision": "52b2899",
"time": "2020-04-22T17:53:12Z",
"version": "1.17.0"
}
{
"level": "info",
"msg": "URL: https://gitlab.com/gitlab-org/gitlab-pages",
"time": "2020-04-22T17:53:12Z"
}
{
"gid": 998,
"in-place": false,
"level": "info",
"msg": "running the daemon as unprivileged user",
"time": "2020-04-22T17:53:12Z",
"uid": 998
}
マターモスト・ログ
Omnibus GitLab インストールの場合、Mattermost のログは/var/log/gitlab/mattermost/mattermost.log
にあります。
ワークホース丸太
Omnibus GitLab インストールの場合、Workhorse のログは/var/log/gitlab/gitlab-workhorse/
にあります。
PostgreSQL ログ
Omnibus GitLabのインストールでは、PostgreSQLのログは/var/log/gitlab/postgresql/
。
プロメテウス・ログ
Omnibus GitLab インストールの場合、Prometheus のログは/var/log/gitlab/prometheus/
にあります。
Redisログ
Omnibus GitLabのインストールでは、Redisのログは/var/log/gitlab/redis/
。
アラートマネージャーのログ
Omnibus GitLabのインストールでは、Alertmanagerのログは/var/log/gitlab/alertmanager/
。
クロンログ
Omnibus GitLab インストールの場合、crond のログは/var/log/gitlab/crond/
にあります。
Grafana ログ
Omnibus GitLabのインストールでは、Grafanaのログは/var/log/gitlab/grafana/
。
ログ回転ログ
Omnibus GitLabの内部では、logrotateのログは/var/log/gitlab/logrotate/
。
GitLab モニターログ
Omnibus GitLab インストールの場合、GitLab Monitor のログは/var/log/gitlab/gitlab-monitor/
にあります。
GitLab Exporter
Omnibus GitLabのインストールでは、GitLab Exporterのログは/var/log/gitlab/gitlab-exporter/
。