로그 시스템

Tier: Free, Premium, Ultimate Offering: Self-managed

GitLab에는 모든 것이 기록되는 고급 로그 시스템이 있어서 다양한 시스템 로그 파일을 사용하여 인스턴스를 분석할 수 있습니다. 로그 시스템은 감사 이벤트와 비슷합니다.

시스템 로그 파일은 일반적으로 표준 로그 파일 형식의 일반 텍스트입니다. 이 가이드에서는 이러한 시스템 로그 파일을 읽고 사용하는 방법에 대해 다룹니다.

로그 시스템 및 로그 사용에 대해 자세히 알아보세요:

로그 레벨

각 로그 메시지에는 중요도와 자세함을 나타내는 할당된 로그 레벨이 있습니다. 각 로거에는 할당된 최소 로그 레벨이 있습니다. 로거는 로그 레벨이 최소 로그 레벨과 같거나 더 높은 경우에만 로그 메시지를 생성합니다.

다음과 같은 로그 레벨이 지원됩니다.

레벨 이름
0 DEBUG
1 INFO
2 WARN
3 ERROR
4 FATAL
5 UNKNOWN

GitLab 로거는 기본적으로 DEBUG로 설정되어 있기 때문에 모든 로그 메시지를 생성합니다.

기본 로그 레벨 변경

GITLAB_LOG_LEVEL 환경 변수를 사용하여 GitLab 로거의 최소 로그 레벨을 재정의할 수 있습니다. 유효한 값은 0에서 5의 값이거나 로그 레벨의 이름입니다.

예시:

GITLAB_LOG_LEVEL=info

일부 서비스의 경우에는 이 설정에 영향을받지 않는 기타 로그 레벨이 있습니다. 이러한 서비스 중 일부는 로그 레벨을 재정의하기 위한 자체 환경 변수가 있습니다. 예를 들어:

서비스 로그 레벨 환경 변수
GitLab API INFO  
GitLab Cleanup INFO DEBUG
GitLab Doctor INFO VERBOSE
GitLab Export INFO EXPORT_DEBUG
GitLab Geo INFO  
GitLab Import INFO IMPORT_DEBUG
GitLab QA Runtime INFO QA_LOG_LEVEL
Google APIs INFO  
Rack Timeout ERROR  
Sidekiq (서버) INFO  
Snowplow Tracker FATAL  
gRPC 클라이언트 (Gitaly) WARN GRPC_LOG_LEVEL
LLM INFO LLM_DEBUG

로그 로테이션

특정 서비스의 로그는 다음과 같이 관리되어 회전될 수 있습니다:

  • logrotate
  • svlogd (runit의 서비스 로깅 데몬)
  • logrotatesvlogd
  • 혹은 전혀 관리되지 않음

다음 표에는 포함된 서비스의 로그를 관리하고 회전하는 책임이 있는 내용이 포함되어 있습니다. 로그는 svlogd에서 관리되는 경우에는 current라는 이름의 파일에 기록됩니다. GitLab 내장 logrotate가 관리하는 로그를 제외한 모든 로그가 runit에서 캡처됩니다.

로그 유형 logrotate에서 관리됨 svlogd/runit에서 관리됨
Alertmanager 로그 No Yes
crond 로그 No Yes
Gitaly Yes Yes
Linux 패키지 설치용 GitLab Exporter No Yes
GitLab Pages 로그 Yes Yes
GitLab Rails Yes No
GitLab Shell 로그 Yes No
Grafana 로그 No Yes
LogRotate 로그 No Yes
Mailroom Yes Yes
NGINX Yes Yes
PgBouncer 로그 No Yes
PostgreSQL 로그 No Yes
Praefect 로그 Yes Yes
Prometheus 로그 No Yes
Puma Yes Yes
Redis 로그 No Yes
Registry 로그 No Yes
Workhorse 로그 Yes Yes

production_json.log

이 파일은 다음 위치에 있습니다.

  • Linux 패키지 설치의 경우 /var/log/gitlab/gitlab-rails/production_json.log에 있습니다.
  • 자체 컴파일 설치의 경우 /home/git/gitlab/log/production_json.log에 있습니다.

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,
  "pid": 81836,
  "worker_id":"puma_0"
}

예를 들어 위 JSON은 특정 이슈에 대한 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에 쓴 총 바이트 수 - pid: 워커의 Linux 프로세스 ID(워커가 다시 시작되면 변경됨) - worker_id: 워커의 논리적 ID(워커가 다시 시작되어도 변경되지 않음)

HTTP 전송을 통한 사용자의 클론 및 페치 활동은 action: git_upload_pack으로 로그에 남습니다.

또한, 로그에는 원본 IP 주소 (remote_ip), 사용자 ID (user_id), 사용자 이름 (username)도 포함되어 있습니다.

몇 가지 엔드포인트(예: /search)는 고급 검색을 사용하는 경우 Elasticsearch로 요청을 보낼 수 있습니다. 이러한 경우 elasticsearch_callselasticsearch_call_duration_s가 추가로 로깅되는데, 이는 다음을 나타냅니다:

  • elasticsearch_calls: Elasticsearch로의 총 호출 횟수
  • elasticsearch_duration_s: Elasticsearch 호출에 소요된 총 시간
  • elasticsearch_timed_out_count: 타임아웃되어 부분적 결과를 반환한 Elasticsearch로의 총 호출 횟수

또한 ActionCable 연결 및 구독 이벤트도 이 파일에 로깅되며 이전의 형식을 따릅니다. method, path, format 필드는 적용되지 않으며 항상 비어 있습니다. ActionCable 연결 또는 채널 클래스가 controller로 사용됩니다.

{
  "method":null,
  "path":null,
  "format":null,
  "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부터 오류가 발생하는 경우 exception 필드에 class, message, 및 backtrace가 포함됩니다. 이전 버전에서는 exception.classexception.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,
  "pid": 81836,
  "worker_id": "puma_0",
  "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

이 파일은 다음 위치에 있습니다:

  • Linux 패키지 설치의 경우 /var/log/gitlab/gitlab-rails/production.log에 있습니다.
  • 직접 컴파일한 경우 /home/git/gitlab/log/production.log에 있습니다.

이 파일에는 수행된 모든 요청에 대한 정보가 포함되어 있습니다. 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)

이 예에서 서버는 IP 168.111.56.1에서 2015-02-12 19:34:53 +0200에 URL이 /gitlabhq/yaml_db/tree/master인 HTTP 요청을 처리했습니다. 해당 요청은 Projects::TreeController에 의해 처리되었습니다.

api_json.log

이 파일은 다음 위치에 있습니다:

  • Linux 패키지 설치의 경우 /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,
  "pid": 81836,
  "worker_id": "puma_0",
  ...
}

이 항목은 연관된 SSH 키가 해당 프로젝트를 git fetch 또는 git clone을 사용하여 다운로드할 수 있는지 확인하기 위해 액세스한 내부 엔드포인트를 보여줍니다. 이 예에서 우리는 다음을 볼 수 있습니다:

  • duration: 요청을 검색하는 데 걸린 총 시간(밀리초 단위)
  • queue_duration: 요청이 GitLab Workhorse 내에서 대기열에 들어간 총 시간(밀리초 단위)
  • method: 요청에 사용된 HTTP 메서드
  • path: 쿼리의 상대적인 경로
  • params: 쿼리 문자열이나 HTTP 본문에 전달된 키-값 쌍(암호 및 토큰과 같은 민감한 매개변수는 필터링됨)
  • ua: 요청자의 User-Agent

application.log (deprecated)

이 파일은 다음 위치에 있습니다.

  • Linux 패키지 설치에서 /var/log/gitlab/gitlab-rails/application.log에 있습니다.
  • 직접 컴파일한 설치에서 /home/git/gitlab/log/application.log에 있습니다.

application_json.log에 있는 로그의 구조화되지 않은 버전을 포함하여 다음과 같은 예시가 있습니다.

October 06, 2014 11:56: 사용자 "Administrator" (admin@example.com)가 생성되었습니다
October 06, 2014 11:56: Documentcloud가 새 프로젝트 "Documentcloud / Underscore"를 생성했습니다
October 07, 2014 11:25: 사용자 "Claudie Hodkiewicz" (nasir_stehr@olson.co.uk)가 제거되었습니다
October 07, 2014 11:25: 프로젝트 "project133"가 제거되었습니다

application_json.log

이 파일은 다음 위치에 있습니다.

  • Linux 패키지 설치에서 /var/log/gitlab/gitlab-rails/application_json.log에 있습니다.
  • 직접 컴파일한 설치에서 /home/git/gitlab/log/application_json.log에 있습니다.

사용자 생성 및 프로젝트 삭제와 같은 인스턴스에서 발생하는 이벤트를 확인하는 데 도움이 됩니다. 예를 들어:

{
  "severity":"INFO",
  "time":"2020-01-14T13:35:15.466Z",
  "correlation_id":"3823a1550b64417f9c9ed8ee0f48087e",
  "message":"사용자 \"Administrator\" (admin@example.com)가 생성되었습니다"
}
{
  "severity":"INFO",
  "time":"2020-01-14T13:35:15.466Z",
  "correlation_id":"78e3df10c9a18745243d524540bd5be4",
  "message":"프로젝트 \"project133\"가 제거되었습니다"
}

integrations_json.log

이 파일은 다음 위치에 있습니다.

  • Linux 패키지 설치에서 /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":"Integrations::Jira",
  "project_id":8,
  "project_path":"h5bp/html5-boilerplate",
  "message":"메시지 전송 오류",
  "client_url":"http://jira.gitlap.com:8080",
  "error":"실행 시간 만료"
}
{
  "severity":"INFO",
  "time":"2018-09-06T17:15:16.365Z",
  "service_class":"Integrations::Jira",
  "project_id":3,
  "project_path":"namespace2/project2",
  "message":"성공적으로 전송됨",
  "client_url":"http://jira.example.com"
}

kubernetes.log (deprecated)

이 파일은 다음 위치에 있습니다.

  • Linux 패키지 설치에서 /var/log/gitlab/gitlab-rails/kubernetes.log에 있습니다.
  • 직접 컴파일한 설치에서 /home/git/gitlab/log/kubernetes.log에 있습니다.

인증서 기반 클러스터와 관련된 연결 오류와 같은 정보를 기록합니다. 각 행에는 Elasticsearch 및 Splunk와 같은 서비스에서 적용할 수 있는 JSON이 포함되어 있습니다.

git_json.log

이 파일은 다음 위치에 있습니다.

  • Linux 패키지 설치에서 /var/log/gitlab/gitlab-rails/git_json.log에 있습니다.
  • 직접 컴파일한 설치에서 /home/git/gitlab/log/git_json.log에 있습니다.

GitLab은 Git 저장소와 상호 작용해야 하지만, 드물게 무언가 잘못될 수 있습니다. 이 경우 정확히 무엇이 발생했는지 알아야 합니다. 이 로그 파일에는 GitLab에서 Git 저장소로의 모든 실패한 요청이 포함되어 있습니다. 대부분의 경우 이 파일은 개발자에게 유용합니다. 예를 들어:

{
   "severity":"ERROR",
   "time":"2019-07-19T22:16:12.528Z",
   "correlation_id":"FeGxww5Hj64",
   "message":"명령 실패 [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

Tier: Free, Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated
note
GitLab Free는 다양한 감사 이벤트를 작은 수로 추적합니다. GitLab Premium은 훨씬 많은 이벤트를 추적합니다.

이 파일은 다음 위치에 있습니다.

  • 리눅스 패키지 설치의 경우 /var/log/gitlab/gitlab-rails/audit_json.log에 있습니다.
  • 자체 컴파일 설치의 경우 /home/git/gitlab/log/audit_json.log에 있습니다.

그룹 또는 프로젝트 설정 및 멤버십 (target_details)에 대한 변경 사항이이 파일에 로그됩니다. 예를 들어:

{
  "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 로그

리눅스 패키지 설치의 경우 일부 Sidekiq 로그는 /var/log/gitlab/sidekiq/current에 있습니다.

sidekiq.log

이 파일은 다음 위치에 있습니다.

  • 리눅스 패키지 설치의 경우 /var/log/gitlab/sidekiq/current에 있습니다.
  • 자체 컴파일 설치의 경우 /home/git/gitlab/log/sidekiq.log에 있습니다.

GitLab은 장기간 소요될 수있는 작업을 처리하기 위해 백그라운드 작업을 사용합니다. 이러한 작업에 대한 모든 정보가이 파일에 기록됩니다. 예를 들어:

{
  "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,
  "worker_id":"sidekiq_0",
  "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
}

JSON 로그 대신 일부 서옵키 큐의 텍스트 로그를 생성하도록 선택할 수 있습니다. 예를 들어:

2023-05-16T16:08:55.272Z pid=82525 tid=23rl INFO: 초기화 웹소켓
2023-05-16T16:08:55.279Z pid=82525 tid=23rl INFO: 프로덕션 환경에서 Rails 6.1.7.2 응용 프로그램 부팅
2023-05-16T16:08:55.279Z pid=82525 tid=23rl INFO: ruby 3.0.5p211 (2022-11-24 수정 ba5cf0f7c5) [arm64-darwin22]에서 실행
2023-05-16T16:08:55.279Z pid=82525 tid=23rl INFO: 라이센스 세부 정보: LICENSE 및 LGPL-3.0을 참조하십시오.
2023-05-16T16:08:55.279Z pid=82525 tid=23rl INFO: 더 많은 기능과 지원을 위해 Sidekiq Pro로 업그레이드: https://sidekiq.org
2023-05-16T16:08:55.286Z pid=82525 tid=7p4t INFO: 작동 큐 정리
2023-05-16T16:09:06.043Z pid=82525 tid=7p7d class=ScheduleMergeRequestCleanupRefsWorker jid=efcc73f169c09a514b06da3f INFO: 시작
2023-05-16T16:09:06.050Z pid=82525 tid=7p7d class=ScheduleMergeRequestCleanupRefsWorker jid=efcc73f169c09a514b06da3f INFO: arguments: []
2023-05-16T16:09:06.065Z pid=82525 tid=7p81 class=UserStatusCleanup::BatchWorker jid=e279aa6409ac33031a314822 INFO: 시작
2023-05-16T16:09:06.066Z pid=82525 tid=7p81 class=UserStatusCleanup::BatchWorker jid=e279aa6409ac33031a314822 INFO: arguments: []

리눅스 패키지 설치의 경우 구성 옵션을 추가하십시오.

sidekiq['log_format'] = 'text'

자체 컴파일 설치의 경우 gitlab.yml를 편집하고 Sidekiqlog_format 구성 옵션을 설정하십시오.

  ## Sidekiq
  sidekiq:
    log_format: text

sidekiq_client.log

  • 이 소개는 GitLab 12.9에서 이루어졌습니다.

이 파일은 다음 위치에 있습니다.

  • Linux 패키지 설치에서는 /var/log/gitlab/gitlab-rails/sidekiq_client.log에 있습니다.
  • 자체 컴파일 설치에서는 /home/git/gitlab/log/sidekiq_client.log에 있습니다.

이 파일은 Sidekiq이 처리되기 전 작업에 대한 로깅 정보를 포함하며, 예를 들어 큐에 들어가기 전과 같이입니다.

이 로그 파일은 위에 언급된대로 Sidekiq에 대해 구성된 경우 JSON 형식과 동일한 구조를 따릅니다.

gitlab-shell.log

GitLab Shell은 GitLab에서 Git 명령을 실행하고 Git 저장소에 SSH 액세스를 제공하는 데 사용됩니다.

git-{upload-pack,receive-pack} 요청을 포함하는 정보는 /var/log/gitlab/gitlab-shell/gitlab-shell.log에 있습니다. Gitaly에서 GitLab Shell로의 후크에 대한 정보는 /var/log/gitlab/gitaly/current에 있습니다.

/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/current의 예시 로그 항목:

{
  "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"
}

Gitaly 로그

이 파일은 /var/log/gitlab/gitaly/current에 있으며 runit에 의해 생성됩니다. runit은 Linux 패키지와 함께 제공되며 그 목적에 대한 간단한 설명은 Linux 패키지 설명서에서 확인할 수 있습니다. 로그 파일은 회전됩니다, Unix 타임스탬프 형식으로 이름이 변경되며 gzip로 압축됩니다 (예: @1584057562.s).

grpc.log

이 파일은 Linux 패키지 설치에서 /var/log/gitlab/gitlab-rails/grpc.log에 있습니다. Gitaly에서 사용하는 native gRPC 로깅입니다.

gitaly_hooks.log

이 파일은 /var/log/gitlab/gitaly/gitaly_hooks.log에 있으며 gitaly-hooks 명령에 의해 생성됩니다. 또한 GitLab API 응답 처리 중 수신된 실패에 대한 기록을 포함합니다.

Puma 로그

puma_stdout.log

이 파일은 다음 위치에 있습니다.

  • Linux 패키지 설치에서는 /var/log/gitlab/puma/puma_stdout.log에 있습니다.
  • 자체 컴파일 설치에서는 /home/git/gitlab/log/puma_stdout.log에 있습니다.

puma_stderr.log

이 파일은 다음 위치에 있습니다.

  • Linux 패키지 설치에서는 /var/log/gitlab/puma/puma_stderr.log에 있습니다.
  • 자체 컴파일 설치에서는 /home/git/gitlab/log/puma_stderr.log에 있습니다.

repocheck.log

이 파일은 다음 위치에 있습니다.

  • Linux 패키지 설치에서는 /var/log/gitlab/gitlab-rails/repocheck.log에 있습니다.
  • 자체 컴파일 설치에서는 /home/git/gitlab/log/repocheck.log에 있습니다.

이 파일은 프로젝트에서 리포지토리 확인이 실행될 때마다 정보를 기록합니다.

importer.log

이 파일은 다음 위치에 있습니다:

  • Linux 패키지 설치에서는 /var/log/gitlab/gitlab-rails/importer.log에 있습니다.
  • 자체 컴파일된 설치에서는 /home/git/gitlab/log/importer.log에 있습니다.

이 파일은 프로젝트 가져오기 및 이주의 진행 상황을 기록합니다.

exporter.log

  • GitLab 13.1에서 소개되었습니다.

이 파일은 다음 위치에 있습니다:

  • Linux 패키지 설치에서는 /var/log/gitlab/gitlab-rails/exporter.log에 있습니다.
  • 자체 컴파일된 설치에서는 /home/git/gitlab/log/exporter.log에 있습니다.

내보내기 프로세스의 진행 상황을 기록합니다.

features_json.log

이 파일은 다음 위치에 있습니다:

  • Linux 패키지 설치에서는 /var/log/gitlab/gitlab-rails/features_json.log에 있습니다.
  • 자체 컴파일된 설치에서는 /home/git/gitlab/log/features_json.log에 있습니다.

GitLab의 기능 플래그에서의 수정 이벤트가 기록됩니다. 예를 들어:

{"severity":"INFO","time":"2020-11-24T02:30:59.860Z","correlation_id":null,"key":"cd_auto_rollback","action":"enable","extra.thing":"true"}
{"severity":"INFO","time":"2020-11-24T02:31:29.108Z","correlation_id":null,"key":"cd_auto_rollback","action":"enable","extra.thing":"true"}
{"severity":"INFO","time":"2020-11-24T02:31:29.129Z","correlation_id":null,"key":"cd_auto_rollback","action":"disable","extra.thing":"false"}
{"severity":"INFO","time":"2020-11-24T02:31:29.177Z","correlation_id":null,"key":"cd_auto_rollback","action":"enable","extra.thing":"Project:1"}
{"severity":"INFO","time":"2020-11-24T02:31:29.183Z","correlation_id":null,"key":"cd_auto_rollback","action":"disable","extra.thing":"Project:1"}
{"severity":"INFO","time":"2020-11-24T02:31:29.188Z","correlation_id":null,"key":"cd_auto_rollback","action":"enable_percentage_of_time","extra.percentage":"50"}
{"severity":"INFO","time":"2020-11-24T02:31:29.193Z","correlation_id":null,"key":"cd_auto_rollback","action":"disable_percentage_of_time"}
{"severity":"INFO","time":"2020-11-24T02:31:29.198Z","correlation_id":null,"key":"cd_auto_rollback","action":"enable_percentage_of_actors","extra.percentage":"50"}
{"severity":"INFO","time":"2020-11-24T02:31:29.203Z","correlation_id":null,"key":"cd_auto_rollback","action":"disable_percentage_of_actors"}
{"severity":"INFO","time":"2020-11-24T02:31:29.329Z","correlation_id":null,"key":"cd_auto_rollback","action":"remove"}

ci_resource_groups_json.log

이 파일은 다음 위치에 있습니다:

  • Linux 패키지 설치에서는 /var/log/gitlab/gitlab-rails/ci_resource_group_json.log에 있습니다.
  • 자체 컴파일된 설치에서는 /home/git/gitlab/log/ci_resource_group_json.log에 있습니다.

리소스 그룹 획득에 관한 정보를 포함하고 있습니다. 예를 들어:

{"severity":"INFO","time":"2023-02-10T23:02:06.095Z","correlation_id":"01GRYS10C2DZQ9J1G12ZVAD4YD","resource_group_id":1,"processable_id":288,"message":"attempted to assign resource to processable","success":true}
{"severity":"INFO","time":"2023-02-10T23:02:08.945Z","correlation_id":"01GRYS138MYEG32C0QEWMC4BDM","resource_group_id":1,"processable_id":288,"message":"attempted to release resource from processable","success":true}

예제에서는 각 항목의 resource_group_id, processable_id, message, success 필드가 표시됩니다.

auth.log

  • GitLab 12.0에서 소개되었습니다.

이 파일은 다음 위치에 있습니다:

  • Linux 패키지 설치에서는 /var/log/gitlab/gitlab-rails/auth.log에 있습니다.
  • 자체 컴파일된 설치에서는 /home/git/gitlab/log/auth.log에 있습니다.

다음을 기록합니다:

  • 사용자의 ID와 사용자명(사용 가능한 경우)을 포함한 Raw Endpoints의 Rate Limit에 대한 요청.
  • 보호된 경로의 오용 요청.
  • GitLab 버전 12.3 이상에서는 사용자 ID 및 사용자명(사용 가능한 경우).

auth_json.log

이 파일은 다음 위치에 있습니다:

  • Linux 패키지 설치의 경우 /var/log/gitlab/gitlab-rails/auth_json.log에 있습니다.
  • 자체 컴파일된 설치의 경우 /home/git/gitlab/log/auth_json.log에 있습니다.

이 파일에는 auth.log의 로그의 JSON 버전이 포함되어 있습니다. 예를 들면:

{
    "severity":"ERROR",
    "time":"2023-04-19T22:14:25.893Z",
    "correlation_id":"01GYDSAKAN2SPZPAMJNRWW5H8S",
    "message":"Rack_Attack",
    "env":"blocklist",
    "remote_ip":"x.x.x.x",
    "request_method":"GET",
    "path":"/group/project.git/info/refs?service=git-upload-pack"
}

graphql_json.log

이 파일은 다음 위치에 있습니다:

  • Linux 패키지 설치의 경우 /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}

clickhouse.log

clickhouse.log 파일은 GitLab의 ClickHouse 데이터베이스 클라이언트와 관련된 정보를 기록합니다.

migrations.log

  • GitLab 12.3에서 도입되었습니다.

이 파일은 다음 위치에 있습니다:

  • Linux 패키지 설치의 경우 /var/log/gitlab/gitlab-rails/migrations.log에 있습니다.
  • 자체 컴파일된 설치의 경우 /home/git/gitlab/log/migrations.log에 있습니다.

이 파일은 데이터베이스 마이그레이션의 진행 상황을 기록합니다.

mail_room_json.log (기본)

이 파일은 다음 위치에 있습니다:

  • Linux 패키지 설치의 경우 /var/log/gitlab/mailroom/current에 있습니다.
  • 자체 컴파일된 설치의 경우 /home/git/gitlab/log/mail_room_json.log에 있습니다.

이 구조화된 로그 파일은 mail_room 젬의 내부 활동을 기록합니다. 이름과 경로는 구성 가능하므로 실제 이름과 경로가 위와 일치하지 않을 수 있습니다.

web_hooks.log

  • GitLab 16.3에서 도입되었습니다.

이 파일은 다음 위치에 있습니다:

  • Linux 패키지 설치의 경우 /var/log/gitlab/gitlab-rails/web_hooks.log에 있습니다.
  • 자체 컴파일된 설치의 경우 /home/git/gitlab/log/web_hooks.log에 있습니다.

Webhook의 백오프, 비활성화 및 재활성화 이벤트가 이 파일에 기록됩니다. 예를 들면:

{"severity":"INFO","time":"2020-11-24T02:30:59.860Z","hook_id":12,"action":"backoff","disabled_until":"2020-11-24T04:30:59.860Z","backoff_count":2,"recent_failures":2}
{"severity":"INFO","time":"2020-11-24T02:30:59.860Z","hook_id":12,"action":"disable","disabled_until":null,"backoff_count":5,"recent_failures":100}
{"severity":"INFO","time":"2020-11-24T02:30:59.860Z","hook_id":12,"action":"enable","disabled_until":null,"backoff_count":0,"recent_failures":0}

재구성 로그

재구성 로그 파일은 Linux 패키지 설치의 경우 /var/log/gitlab/reconfigure에 있습니다. 자체 컴파일된 설치의 경우 재구성 로그가 없습니다. gitlab-ctl reconfigure가 수동으로 실행되거나 업그레이드의 일환으로 실행될 때마다 재구성 로그 파일이 생성됩니다.

재구성 로그 파일은 재구성이 시작된 UNIX 타임스탬프에 따라 이름이 지정됩니다. 예: 1509705644.log

sidekiq_exporter.logweb_exporter.log

Prometheus 메트릭 및 Sidekiq Exporter가 모두 활성화된 경우, Sidekiq는 Web 서버를 시작하고 정의된 포트(default: 8082)로 수신 대기합니다. 기본적으로 Sidekiq Exporter 접근 로그는 비활성화되어 있지만 활성화할 수 있습니다:

  • Linux 패키지 설치의 경우 /etc/gitlab/gitlab.rbsidekiq['exporter_log_enabled'] = true 옵션 사용합니다.
  • 자체 컴파일된 설치의 경우 gitlab.ymlsidekiq_exporter.log_enabled 옵션을 사용합니다.

활성화된 경우 설치 방법에 따라 다음 위치에 있습니다:

  • Linux 패키지 설치의 경우 /var/log/gitlab/gitlab-rails/sidekiq_exporter.log에 있습니다.
  • 자체 컴파일된 설치의 경우 /home/git/gitlab/log/sidekiq_exporter.log에 있습니다.

Prometheus 메트릭 및 Web Exporter가 모두 활성화된 경우, Puma는 Web 서버를 시작하고 정의된 포트(default: 8083)로 수신 대기하며 접근 로그는 설치 방법에 따라 다음 위치에 생성됩니다:

  • Linux 패키지 설치의 경우 /var/log/gitlab/gitlab-rails/web_exporter.log에 있습니다.
  • 자체 컴파일된 설치의 경우 /home/git/gitlab/log/web_exporter.log에 있습니다.

database_load_balancing.log

Tier: Premium, Ultimate Offering: Self-Managed

GitLab Database Load Balancing의 세부 정보가 포함되어 있습니다. 이 파일은 다음 위치에 있습니다:

  • Linux 패키지 설치: /var/log/gitlab/gitlab-rails/database_load_balancing.log
  • 직접 컴파일한 경우: /home/git/gitlab/log/database_load_balancing.log

zoekt.log

Tier: Premium, Ultimate Offering: Self-Managed

이 파일은 정확한 코드 검색과 관련된 정보를 기록합니다. 이 파일은 다음 위치에 있습니다:

  • Linux 패키지 설치: /var/log/gitlab/gitlab-rails/zoekt.log
  • 직접 컴파일한 경우: /home/git/gitlab/log/zoekt.log

elasticsearch.log

Tier: Premium, Ultimate Offering: Self-Managed
  • GitLab 12.6에 도입되었습니다.

이 파일은 Elasticsearch 통합과 관련된 정보를 기록합니다. Elasticsearch의 색인 또는 검색 중 발생한 오류를 포함합니다. 이 파일은 다음 위치에 있습니다:

  • Linux 패키지 설치: /var/log/gitlab/gitlab-rails/elasticsearch.log
  • 직접 컴파일한 경우: /home/git/gitlab/log/elasticsearch.log

각 행에는 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::ErrorTracking에 의해 추적되는 예외에 관한 정보를 기록합니다. 이것은 rescued exceptions를 처리하는 표준적이고 일관된 방법을 제공합니다. 이 파일은 다음 위치에 있습니다:

  • Linux 패키지 설치: /var/log/gitlab/gitlab-rails/exceptions_json.log
  • 직접 컴파일한 경우: /home/git/gitlab/log/exceptions_json.log

각 행에는 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에 도입되었습니다.

이 파일은 다음 위치에 있습니다:

  • Linux 패키지 설치: /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

Tier: 프리미엄, 얼티밋 Offering: Self-managed

Geo는 구조화된 로그 메시지를 geo.log 파일에 저장합니다. Linux 패키지 설치의 경우, 해당 파일은 /var/log/gitlab/gitlab-rails/geo.log에 있습니다.

Helm 차트 설치의 경우, Sidekiq pod에 저장되며, /var/log/gitlab/geo.log에 저장됩니다. 해당 파일은 직접 파일에 액세스하거나 kubectl을 사용하여 Sidekiq 로그를 가져 와 "subcomponent"=="geo"로 결과를 필터링 함으로써 읽을 수 있습니다. 아래 예제는 jq를 사용하여 Geo 로그 만 가져 오는 방법을 보여줍니다.

kubectl logs -l app=sidekiq --max-log-requests=50 | jq 'select(."subcomponent"=="geo")'

이 파일에는 Geo가 저장소 및 파일을 동기화하려고 시도하는 시간에 대한 정보가 포함되어 있습니다. 파일의 각 줄은 (예: Elasticsearch 또는 Splunk)에서 수용될 수있는 별도의 JSON 항목을 포함합니다.

예를 들어:

{"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에 대한 저장소 업데이트가 필요함을 감지했음을 보여줍니다.

update_mirror_service_json.log

이 파일은 다음 위치에 있습니다.

  • Linux 패키지 설치의 경우 /var/log/gitlab/gitlab-rails/update_mirror_service_json.log에 있습니다.
  • 자체 컴파일 설치의 경우 /home/git/gitlab/log/update_mirror_service_json.log에 있습니다.

이 파일에는 프로젝트 미러링 중 발생한 LFS 오류에 대한 정보가 포함되어 있습니다. 기타 프로젝트 미러링 오류를 이 로그로 이동하는 작업 중에는일반 로그를 사용할 수 있습니다.

{
   "severity":"ERROR",
   "time":"2020-07-28T23:29:29.473Z",
   "correlation_id":"5HgIkCJsO53",
   "user_id":"x",
   "project_id":"x",
   "import_url":"https://mirror-source/group/project.git",
   "error_message":"The LFS objects download list couldn't be imported. Error: Unauthorized"
}

llm.log

Tier: 얼티밋 Offering: GitLab.com

llm.log 파일은 AI 기능에 관련된 정보를 기록합니다.

이 파일은 다음 위치에 있습니다.

  • Linux 패키지 설치의 경우 /var/log/gitlab/gitlab-rails/llm.log에 있습니다.
  • 자체 컴파일 설치의 경우 /home/git/gitlab/log/llm.log에 있습니다.

epic_work_item_sync.log

Tier: 프리미엄, 얼티밋 Offering: GitLab.com, Self-managed, GitLab Dedicated

epic_work_item_sync.log 파일은 epic을 작업 항목으로 동기화하고 마이그레이션하는 관련 정보를 기록합니다.

이 파일은 다음 위치에 있습니다.

  • Linux 패키지 설치의 경우 /var/log/gitlab/gitlab-rails/epic_work_item_sync.log에 있습니다.
  • 자체 컴파일 설치의 경우 /home/git/gitlab/log/epic_work_item_sync.log에 있습니다.

레지스트리 로그

Linux 패키지 설치의 경우, 컨테이너 레지스트리 로그는 /var/log/gitlab/registry/current에 있습니다.

NGINX 로그

Linux 패키지 설치의 경우, 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"'

$request$http_referer는 기밀 토큰과 같은 민감한 쿼리 문자열 매개변수를 위해 필터링됩니다.

페이지 로그

Linux 패키지 설치의 경우, 페이지 로그는 /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
}

Let’s Encrypt 로그

Linux 패키지 설치의 경우, Let’s Encrypt 자동 갱신 로그는 /var/log/gitlab/lets-encrypt/에 있습니다.

Mattermost 로그

Linux 패키지 설치의 경우, Mattermost 로그는 다음 위치에 있습니다:

  • /var/log/gitlab/mattermost/mattermost.log
  • /var/log/gitlab/mattermost/current

Workhorse 로그

Linux 패키지 설치의 경우, Workhorse 로그는 /var/log/gitlab/gitlab-workhorse/current에 있습니다.

PgBouncer 로그

Linux 패키지 설치의 경우, PgBouncer 로그는 /var/log/gitlab/pgbouncer/current에 있습니다.

PostgreSQL 로그

Linux 패키지 설치의 경우, PostgreSQL 로그는 /var/log/gitlab/postgresql/current에 있습니다.

Prometheus 로그

Linux 패키지 설치의 경우, Prometheus 로그는 /var/log/gitlab/prometheus/current에 있습니다.

Redis 로그

Linux 패키지 설치의 경우, Redis 로그는 /var/log/gitlab/redis/current에 있습니다.

Alertmanager 로그

Linux 패키지 설치의 경우, Alertmanager 로그는 /var/log/gitlab/alertmanager/current에 있습니다.

crond 로그

Linux 패키지 설치의 경우, crond 로그는 /var/log/gitlab/crond/에 있습니다.

Grafana 로그

Linux 패키지 설치의 경우, Grafana 로그는 /var/log/gitlab/grafana/current에 있습니다.

LogRotate 로그

Linux 패키지 설치의 경우, logrotate 로그는 /var/log/gitlab/logrotate/current에 있습니다.

GitLab Monitor 로그

Linux 패키지 설치의 경우, GitLab Monitor 로그는 /var/log/gitlab/gitlab-monitor/에 있습니다.

GitLab Exporter

Linux 패키지 설치의 경우, GitLab Exporter 로그는 /var/log/gitlab/gitlab-exporter/current에 있습니다.

GitLab 에이전트 서버

Linux 패키지 설치의 경우, GitLab 에이전트 서버 로그는 /var/log/gitlab/gitlab-kas/current에 있습니다.

Praefect 로그

Linux 패키지 설치의 경우, Praefect 로그는 /var/log/gitlab/praefect/에 있습니다.

GitLab은 또한 Praefect의 Prometheus 메트릭을 추적합니다.

백업 로그

Linux 패키지 설치의 경우, 백업 로그는 /var/log/gitlab/gitlab-rails/backup_json.log에 있습니다.

이 로그는 GitLab 백업이 생성될 때 채워집니다. 이 로그를 사용하여 백업 프로세스의 수행 상황을 이해할 수 있습니다.

성능 바 통계

이 파일은 다음 위치에 있습니다:

  • Linux 패키지 설치에서는 /var/log/gitlab/gitlab-rails/performance_bar_json.log에 있습니다.
  • 자체 컴파일된 설치에서는 /home/git/gitlab/log/performance_bar_json.log에 있습니다.

성능 바 통계(현재 SQL 쿼리의 소요 시간만 기록됨)가 해당 파일에 기록됩니다. 예시:

{"severity":"INFO","time":"2020-12-04T09:29:44.592Z","correlation_id":"33680b1490ccd35981b03639c406a697","filename":"app/models/ci/pipeline.rb","method_path":"app/models/ci/pipeline.rb:each_with_object","request_id":"rYHomD0VJS4","duration_ms":26.889,"count":2,"query_type": "active-record"}

이 통계는 .com에서만 로그에 남겨지며, 자체 배포 시 비활성화됩니다.

로그 수집

이전에 나열된 구성 요소 중 하나에 국한되지 않은 문제를 문제 해결할 때, GitLab 인스턴스에서 여러 로그와 통계를 동시에 수집하는 것이 도움이 됩니다.

참고: GitLab 지원팀은 이들 중 하나를 요청하고 필요한 도구를 유지합니다.

주요 로그 간단히 확인하기

버그 또는 오류가 쉽게 재현 가능한 경우, 문제를 몇 번 재현하는 동안 주요 GitLab 로그를 파일에 저장하세요.

sudo gitlab-ctl tail | tee /tmp/<case-ID-and-keywords>.log

Control + C로 로그 수집을 마무리하세요.

GitLabSOS

이전에 나열된 GitLab 구성 요소 중 하나로 손쉽게 할당되지 않는 성능 저하나 연쇄적 에러가 발생하는 경우, GitLabSOS가 GitLab 인스턴스에 대한 보다 넓은 관점을 제공할 수 있습니다. 더 많은 정보 및 실행 방법은 GitLabSOS 설명서를 참조하세요.

Fast-stats

Fast-stats는 GitLab 로그에서 성능 통계를 생성하고 비교하는 도구입니다. 자세한 내용 및 실행 방법은 fast-stats 설명서를 참조하세요.

상관 ID를 사용하여 관련 로그 항목 찾기

대부분의 요청에는 관련 로그 항목을 찾는 데 사용할 수 있는 로그 ID가 있습니다. 관련 로그 항목 찾기