<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # Log system > 原文:[https://docs.gitlab.com/ee/administration/logs.html](https://docs.gitlab.com/ee/administration/logs.html) * [`production_json.log`](#production_jsonlog) * [`production.log`](#productionlog) * [`api_json.log`](#api_jsonlog) * [`application.log`](#applicationlog) * [`application_json.log`](#application_jsonlog) * [`integrations_json.log`](#integrations_jsonlog) * [`kubernetes.log`](#kuberneteslog) * [`git_json.log`](#git_jsonlog) * [`audit_json.log`](#audit_jsonlog) * [Sidekiq Logs](#sidekiq-logs) * [`sidekiq.log`](#sidekiqlog) * [`sidekiq_client.log`](#sidekiq_clientlog) * [`gitlab-shell.log`](#gitlab-shelllog) * [For GitLab versions 12.10 and up](#for-gitlab-versions-1210-and-up) * [For GitLab versions 12.5 through 12.9](#for-gitlab-versions-125-through-129) * [For GitLab 12.5 and earlier](#for-gitlab-125-and-earlier) * [Gitaly Logs](#gitaly-logs) * [`grpc.log`](#grpclog) * [Puma Logs](#puma-logs) * [`puma_stdout.log`](#puma_stdoutlog) * [`puma_stderr.log`](#puma_stderrlog) * [Unicorn Logs](#unicorn-logs) * [`unicorn_stdout.log`](#unicorn_stdoutlog) * [`unicorn_stderr.log`](#unicorn_stderrlog) * [`repocheck.log`](#repochecklog) * [`importer.log`](#importerlog) * [`exporter.log`](#exporterlog) * [`auth.log`](#authlog) * [`graphql_json.log`](#graphql_jsonlog) * [`migrations.log`](#migrationslog) * [`mail_room_json.log` (default)](#mail_room_jsonlog-default) * [Reconfigure Logs](#reconfigure-logs) * [`sidekiq_exporter.log` and `web_exporter.log`](#sidekiq_exporterlog-and-web_exporterlog) * [`database_load_balancing.log`](#database_load_balancinglog-premium-only) * [`elasticsearch.log`](#elasticsearchlog-starter-only) * [`exceptions_json.log`](#exceptions_jsonlog) * [`service_measurement.log`](#service_measurementlog) * [`geo.log`](#geolog-premium-only) * [Registry Logs](#registry-logs) * [NGINX Logs](#nginx-logs) * [Pages Logs](#pages-logs) * [Mattermost Logs](#mattermost-logs) * [Workhorse Logs](#workhorse-logs) * [PostgreSQL Logs](#postgresql-logs) * [Prometheus Logs](#prometheus-logs) * [Redis Logs](#redis-logs) * [Alertmanager Logs](#alertmanager-logs) * [Crond Logs](#crond-logs) * [Grafana Logs](#grafana-logs) * [LogRotate Logs](#logrotate-logs) * [GitLab Monitor Logs](#gitlab-monitor-logs) * [GitLab Exporter](#gitlab-exporter) # Log system[](#log-system "Permalink") GitLab 具有一個高級日志系統,可以記錄所有內容,因此您可以使用各種系統日志文件分析實例. 除了系統日志文件,GitLab 企業版還提供審核事件. [在審核事件文檔中](audit_events.html)找到有關它們的更多信息. 系統日志文件通常是標準日志文件格式的純文本. 本指南討論如何讀取和使用這些系統日志文件. ## `production_json.log`[](#production_jsonlog "Permalink") 對于 Omnibus GitLab 軟件包,此文件位于`/var/log/gitlab/gitlab-rails/production_json.log` ,對于從源代碼進行安裝則位于`/home/git/gitlab/log/production_json.log`中. 當 GitLab 在生產環境以外的環境中運行時,此處將顯示相應的日志文件. 由于[Lograge](https://github.com/roidrage/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 請求. 每行還包含性能數據,時間以秒為單位: 1. `duration_s` :檢索請求所花費的總時間 2. `queue_duration_s` :請求在 GitLab Workhorse 中排隊的總時間 3. `view_duration_s` :在 Rails 視圖中`view_duration_s`總時間 4. `db_duration_s` :從 PostgreSQL 檢索數據的總時間 5. `cpu_s` :在 CPU 上花費的總時間 6. `gitaly_duration_s` :Gitaly 調用花費的總時間 7. `gitaly_calls` :撥打 Gitaly 的電話總數 8. `redis_calls` :對 Redis 的呼叫總數 9. `redis_duration_s` :從 Redis 檢索數據的總時間 10. `redis_read_bytes` :從 Redis 讀取的總字節 11. `redis_write_bytes` :寫入 Redis 的總字節數 12. `redis_<instance>_calls`: total number of calls made to a Redis instance 13. `redis_<instance>_duration_s` :從 Redis 實例檢索數據的總時間 14. `redis_<instance>_read_bytes` :從 Redis 實例讀取的總字節數 15. `redis_<instance>_write_bytes` :寫入 Redis 實例的總字節數 使用 HTTP 傳輸的用戶克隆和獲取活動作為`action: git_upload_pack`出現在此日志中`action: git_upload_pack` . 此外,日志還包含原始 IP 地址( `remote_ip` ),用戶 ID( `user_id` )和用戶名( `username` ). 如果使用[Advanced Global Search,](../user/search/advanced_global_search.html)則某些端點(例如`/search`可能會向 Elasticsearch 發出請求. 這些將另外記錄`elasticsearch_calls`和`elasticsearch_call_duration_s` ,它們對應于: 1. `elasticsearch_calls` :對 Elasticsearch 的調用總數 2. `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 } ``` **注意:**從 GitLab 12.5 開始,如果發生錯誤,則`class` , `message`和`backtrace`包含一個`exception`字段. 以前的版本包含一個`error`字段,而不是`exception.class`和`exception.message` . 例如: ``` { "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`[](#productionlog "Permalink") 對于 Omnibus GitLab 軟件包,此文件位于`/var/log/gitlab/gitlab-rails/production.log` ,對于從源代碼進行安裝,該文件位于`/home/git/gitlab/log/production.log`中. (當 GitLab 在生產環境以外的環境中運行時,此處將顯示相應的日志文件.) 它包含有關所有已執行請求的信息. 您可以查看 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) ``` 在此示例中,服務器在`2015-02-12 19:34:53 +0200`處處理了來自 IP `168.111.56.1` URL `/gitlabhq/yaml_db/tree/master`的 HTTP 請求. 該請求已由`Projects::TreeController` . ## `api_json.log`[](#api_jsonlog "Permalink") 在 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`下載有問題的項目. 在此示例中,我們看到: 1. `duration` :檢索請求所花費的總時間(以毫秒為單位) 2. `queue_duration` :請求在 GitLab Workhorse 中排隊的總時間(以毫秒為單位) 3. `method` :用于發出請求的 HTTP 方法 4. `path` :查詢的相對路徑 5. `params` :在查詢字符串或 HTTP 正文中傳遞的鍵/值對. 敏感參數(例如密碼和令牌)被過濾掉. 6. `ua` :請求者的用戶代理 ## `application.log`[](#applicationlog "Permalink") 對于 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`[](#application_jsonlog "Permalink") 在 GitLab 12.7 中[引入](https://gitlab.com/gitlab-org/gitlab/-/issues/22812) . 對于 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`[](#integrations_jsonlog "Permalink") 對于 Omnibus GitLab 軟件包,此文件位于`/var/log/gitlab/gitlab-rails/integrations_json.log` ,對于從源代碼進行安裝則位于`/home/git/gitlab/log/integrations_json.log`中. 它包含有關[集成](../user/project/integrations/overview.html)活動的信息,例如 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`[](#kuberneteslog "Permalink") 在 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`[](#git_jsonlog "Permalink") 對于 Omnibus GitLab 軟件包,此文件位于`/var/log/gitlab/gitlab-rails/git_json.log` ,對于從源代碼進行安裝則位于`/home/git/gitlab/log/git_json.log`中. **注意:**在 12.2 之后,此文件從`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`[](#audit_jsonlog "Permalink") **注意:**大多數日志條目僅存在于[GitLab Starter 中](https://about.gitlab.com/pricing/) ,而少數存在于 GitLab Core 中. 對于 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 Logs[](#sidekiq-logs "Permalink") 對于 Omnibus 安裝,一些 Sidekiq 日志位于`/var/log/gitlab/sidekiq/current` ,如下所示. ### `sidekiq.log`[](#sidekiqlog "Permalink") 對于 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`并設置 Sidekiq `log_format`配置選項: ``` ## Sidekiq sidekiq: log_format: json ``` ### `sidekiq_client.log`[](#sidekiq_clientlog "Permalink") 在 GitLab 12.9 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26586) . 對于 Omnibus GitLab 軟件包,此文件位于`/var/log/gitlab/gitlab-rails/sidekiq_client.log` ,對于從源代碼進行安裝則位于`/home/git/gitlab/log/sidekiq_client.log`中. 該文件包含有關 Sidekiq 開始處理作業之前(例如,入隊前)的日志信息. 該日志文件采用與[`sidekiq.log`](#sidekiqlog)相同的結構,因此,如果您如上所述為 Sidekiq 配置了此文件,則該文件將構造為 JSON. ## `gitlab-shell.log`[](#gitlab-shelllog "Permalink") GitLab 使用 GitLab Shell 執行 Git 命令,并提供對 Git 存儲庫的 SSH 訪問. ### For GitLab versions 12.10 and up[](#for-gitlab-versions-1210-and-up "Permalink") 對于 GitLab 版本 12.10 和更高版本,有 2 個`gitlab-shell.log`文件. 包含`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" } ``` ### For GitLab versions 12.5 through 12.9[](#for-gitlab-versions-125-through-129 "Permalink") 對于 GitLab 12.5 至 12.9,對于 Omnibus GitLab 軟件包,此文件位于`/var/log/gitlab/gitaly/gitlab-shell.log` ,對于從源代碼進行安裝則位于`/home/git/gitaly/gitlab-shell.log`中. Example log entries: ``` { "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" } ``` ### For GitLab 12.5 and earlier[](#for-gitlab-125-and-earlier "Permalink") 對于 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. ``` `executing git command <gitaly-upload-pack...`使用 SSH 傳輸的用戶克隆/獲取活動將出現在此日志中. ## Gitaly Logs[](#gitaly-logs "Permalink") 該文件位于`/var/log/gitlab/gitaly/current` ,由[runit 生成](http://smarden.org/runit/) . `runit`與 Omnibus GitLab 打包在一起,其用途的簡要說明[在 Omnibus GitLab 文檔中提供](https://docs.gitlab.com/omnibus/architecture/) . [日志文件被旋轉](http://smarden.org/runit/svlogd.8.html) ,以 Unix 時間戳格式重命名,并經過`gzip`壓縮(如`@1584057562.s` ). ### `grpc.log`[](#grpclog "Permalink") 該文件位于 Omnibus GitLab 軟件包的`/var/log/gitlab/gitlab-rails/grpc.log`中. [Gitaly](https://grpc.io/)使用的本機[gRPC](https://grpc.io/)日志記錄. ## Puma Logs[](#puma-logs "Permalink") ### `puma_stdout.log`[](#puma_stdoutlog "Permalink") 對于 Omnibus GitLab 軟件包,此文件位于`/var/log/gitlab/puma/puma_stdout.log`中,對于從源代碼進行的安裝,該文件位于`/home/git/gitlab/log/puma_stdout.log`中. ### `puma_stderr.log`[](#puma_stderrlog "Permalink") 對于 Omnibus GitLab 軟件包,此文件位于`/var/log/gitlab/puma/puma_stderr.log`中,對于從源代碼進行的安裝則位于`/home/git/gitlab/log/puma_stderr.log`中. ## Unicorn Logs[](#unicorn-logs "Permalink") **注意:**從 GitLab 13.0 開始,Puma 是基于 GitLab 多合一軟件包的安裝以及 GitLab Helm 圖表部署中使用的默認 Web 服務器. ### `unicorn_stdout.log`[](#unicorn_stdoutlog "Permalink") 對于 Omnibus GitLab 軟件包,此文件位于`/var/log/gitlab/unicorn/unicorn_stdout.log`中,對于從源代碼進行的安裝,該文件位于`/home/git/gitlab/log/unicorn_stdout.log`中. ### `unicorn_stderr.log`[](#unicorn_stderrlog "Permalink") 對于 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`[](#repochecklog "Permalink") 對于 Omnibus GitLab 軟件包,此文件位于`/var/log/gitlab/gitlab-rails/repocheck.log` ,對于來自源的安裝,該文件位于`/home/git/gitlab/log/repocheck.log`中. 每當在項目上[運行存儲庫檢查](repository_checks.html)時,它都會記錄信息. ## `importer.log`[](#importerlog "Permalink") 在 GitLab 11.3 中引入. 對于 Omnibus GitLab 軟件包,此文件位于`/var/log/gitlab/gitlab-rails/importer.log` ,對于從源代碼進行安裝則位于`/home/git/gitlab/log/importer.log`中. 它記錄導入過程的進度. ## `exporter.log`[](#exporterlog "Permalink") 在 GitLab 13.1 中引入. 對于 Omnibus GitLab 軟件包,此文件位于`/var/log/gitlab/gitlab-rails/exporter.log` ,對于來自源的安裝,該文件位于`/home/git/gitlab/log/exporter.log`中. 它記錄導出過程的進度. ## `auth.log`[](#authlog "Permalink") 在 GitLab 12.0 中引入. 對于 Omnibus GitLab 軟件包,此文件位于`/var/log/gitlab/gitlab-rails/auth.log` ,對于來自源的安裝,該文件位于`/home/git/gitlab/log/auth.log`中. 該日志記錄: * 每當[Rack Attack](../security/rack_attack.html)注冊濫用請求時提供的信息. * 請求超過原始端點上的[速率限制](../user/admin_area/settings/rate_limits_on_raw_endpoints.html) . * [受保護的路徑](../user/admin_area/settings/protected_paths.html)濫用請求. **注意:**在 GitLab [12.3](https://gitlab.com/gitlab-org/gitlab/-/issues/29239)和更高版本中,用戶 ID 和用戶名也會記錄在該日志中(如果有). ## `graphql_json.log`[](#graphql_jsonlog "Permalink") [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/59587) in 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`[](#migrationslog "Permalink") 在 GitLab 12.3 中引入. 對于 Omnibus GitLab 軟件包,此文件位于`/var/log/gitlab/gitlab-rails/migrations.log` ,對于從源代碼進行安裝則位于`/home/git/gitlab/log/migrations.log`中. ## `mail_room_json.log` (default)[](#mail_room_jsonlog-default "Permalink") 在 GitLab 12.6 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/19186) . 對于 Omnibus GitLab 軟件包,此文件位于`/var/log/gitlab/mailroom/current` ,對于來自源的安裝,該文件位于`/home/git/gitlab/log/mail_room_json.log`中. 這個結構化的日志文件將內部活動記錄在`mail_room` gem 中. 它的名稱和路徑是可配置的,因此名稱和路徑可能與上面的不匹配. ## Reconfigure Logs[](#reconfigure-logs "Permalink") 為 Omnibus GitLab 軟件包`/var/log/gitlab/reconfigure`日志文件. 從源安裝沒有重新配置日志. 每當手動或作為升級的一部分運行`gitlab-ctl reconfigure`時, `gitlab-ctl reconfigure`填充一個重配置日志. 根據啟動重新配置的 UNIX 時間戳記來命名重新配置日志文件,例如`1509705644.log` ## `sidekiq_exporter.log` and `web_exporter.log`[](#sidekiq_exporterlog-and-web_exporterlog "Permalink") 如果同時啟用了 Prometheus 指標和 Sidekiq 導出器,則 Sidekiq 將啟動 Web 服務器并偵聽定義的端口(默認值: `8082` ). 對于 Omnibus GitLab 軟件包,訪問日志將在`/var/log/gitlab/gitlab-rails/sidekiq_exporter.log`中生成,對于從源代碼進行的安裝,將在`/home/git/gitlab/log/sidekiq_exporter.log`生成. 如果同時啟用了 Prometheus 指標和 Web 導出器,則 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`[](#database_load_balancinglog-premium-only "Permalink") 在 GitLab 12.3 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/15442) . 包含 GitLab 的[數據庫負載平衡的](database_load_balancing.html)詳細信息. 它存儲在: * `/var/log/gitlab/gitlab-rails/database_load_balancing.log`用于 Omnibus GitLab 軟件包. * `/home/git/gitlab/log/database_load_balancing.log`用于從源代碼進行安裝. ## `elasticsearch.log`[](#elasticsearchlog-starter-only "Permalink") 在 GitLab 12.6 中引入. 對于 Omnibus GitLab 軟件包,此文件位于`/var/log/gitlab/gitlab-rails/elasticsearch.log` ,對于來自源的安裝,該文件位于`/home/git/gitlab/log/elasticsearch.log`中. 它記錄與 Elasticsearch Integration 相關的信息,包括在索引或搜索 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`[](#exceptions_jsonlog "Permalink") 在 GitLab 12.6 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/17819) . 對于 Omnibus GitLab 軟件包,此文件位于`/var/log/gitlab/gitlab-rails/exceptions_json.log` ,對于從源代碼進行安裝則位于`/home/git/gitlab/log/exceptions_json.log`中. 它記錄有關`Gitlab::ErrorTracking`跟蹤的異常的信息,該信息提供了一種標準且一致的方式來[處理已獲救的異常](https://gitlab.com/gitlab-org/gitlab/blob/master/doc/development/logging.md#exception-handling) . 每行包含一個可由 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`[](#service_measurementlog "Permalink") 在 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` `gc_stats` . 例如: ``` { "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`[](#geolog-premium-only "Permalink") > 在 9.5 中引入. Geo 將結構化日志消息存儲在`geo.log`文件中. 對于 Omnibus 安裝,此文件位于`/var/log/gitlab/gitlab-rails/geo.log` . 該文件包含有關 Geo 何時嘗試同步存儲庫和文件的信息. 文件中的每一行都包含一個可以提取的單獨的 JSON 條目. 例如,Elasticsearch 或 Splunk. For example: ``` {"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`需要存儲庫更新. ## Registry Logs[](#registry-logs "Permalink") 對于 Omnibus 安裝,容器注冊表日志位于`/var/log/gitlab/registry/current` . ## NGINX Logs[](#nginx-logs "Permalink") 對于 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" ``` ## Pages Logs[](#pages-logs "Permalink") 對于 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 } ``` ## Mattermost Logs[](#mattermost-logs "Permalink") For Omnibus GitLab installations, Mattermost logs reside in `/var/log/gitlab/mattermost/mattermost.log`. ## Workhorse Logs[](#workhorse-logs "Permalink") 對于 Omnibus GitLab 安裝,Workhorse 日志位于`/var/log/gitlab/gitlab-workhorse/` . ## PostgreSQL Logs[](#postgresql-logs "Permalink") 對于 Omnibus GitLab 安裝,PostgreSQL 日志位于`/var/log/gitlab/postgresql/` . ## Prometheus Logs[](#prometheus-logs "Permalink") 對于 Omnibus GitLab 安裝,Prometheus 日志位于`/var/log/gitlab/prometheus/` . ## Redis Logs[](#redis-logs "Permalink") 對于所有安裝的 GitLab,它返回的日志位于`/var/log/gitlab/redis/` . ## Alertmanager Logs[](#alertmanager-logs "Permalink") 對于 Omnibus GitLab 安裝,Alertmanager 日志位于`/var/log/gitlab/alertmanager/` . ## Crond Logs[](#crond-logs "Permalink") 對于 Omnibus GitLab 安裝,crond 日志位于`/var/log/gitlab/crond/` . ## Grafana Logs[](#grafana-logs "Permalink") 對于 Omnibus GitLab 安裝,Grafana 日志位于`/var/log/gitlab/grafana/` . ## LogRotate Logs[](#logrotate-logs "Permalink") 對于 Omnibus GitLab 安裝,logrotate 日志位于`/var/log/gitlab/logrotate/` . ## GitLab Monitor Logs[](#gitlab-monitor-logs "Permalink") 對于 Omnibus GitLab 安裝,GitLab Monitor 日志位于`/var/log/gitlab/gitlab-monitor/` . ## GitLab Exporter[](#gitlab-exporter "Permalink") 對于 Omnibus GitLab 安裝,GitLab Exporter 日志位于`/var/log/gitlab/gitlab-exporter/` .
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看