Home Development Tools git How to view logs on the gitlab server side

How to view logs on the gitlab server side

Apr 10, 2023 am 09:35 AM

Viewing logs in GitLab is a necessary operation for GitLab administrators to perform system management and maintenance. GitLab provides a wealth of operation logs, allowing administrators to easily understand the running status and operation of the system, discover problems in a timely manner and handle them. The following is how to view logs on the GitLab server side.

1. Log in to the GitLab server
Log in to the GitLab administrator account on the server.

2. Enter the GitLab installation directory
Enter the GitLab installation directory, usually located in the /opt/gitlab directory.

3. Use the cat command to view the log
Enter the following command in the terminal to view the main log of GitLab:

sudo cat /var/log/gitlab/gitlab-rails/production.log

This command will output all the contents in production.log to the terminal. Among them, the main log files of the GitLab Rails application are stored in the /var/log/gitlab/gitlab-rails/ directory. You can use the ls command to view all log files in the directory. Use the tail command to view the log content in real time, such as:

tail -f /var/log/gitlab/gitlab-rails/production.log

4. View GitLab exception log
GitLab Exception logs can help administrators discover system problems and locate the cause of the problems. You can view the exception log in the GitLab installation directory:

sudo cat /var/log/gitlab/gitlab-rails/production_json.log

This log file records the JSON of the GitLab Rails application Exception information. You can use the cat command to browse the entire file, or you can use the grep command to quickly find information about specific exceptions, for example:

sudo cat /var/log/gitlab/gitlab-rails/production_json.log | grep "error message"

5. View other logs
In addition to the main logs and exception logs of the GitLab Rails application, the GitLab system will also record other logs with information related to the operation of the system itself. Other common log files include:

1.gitlab-shell log
gitlab-shell includes the basic application for processing Git command requests, and its log file is located at /var/log/gitlab/gitlab -shell/ directory.

sudo cat /var/log/gitlab/gitlab-shell/gitlab-shell.log

2.unicorn log
unicorn is the server for the GitLab Rails application, and its log files are located at /var/log/gitlab/unicorn/ directory.

sudo cat /var/log/gitlab/unicorn/unicorn_stdout.log

The above is how to view the log on the GitLab server. By viewing logs, administrators can understand the running status and operation of the GitLab system, and discover and solve problems in a timely manner.

The above is the detailed content of How to view logs on the gitlab server side. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

The difference between commit and push of git The difference between commit and push of git Mar 06, 2025 pm 01:37 PM

The difference between commit and push of git

How to use git management tools for complete usage of git management tools How to use git management tools for complete usage of git management tools Mar 06, 2025 pm 01:32 PM

How to use git management tools for complete usage of git management tools

How to solve the failure of git commit submission How to solve the failure of git commit submission Mar 06, 2025 pm 01:38 PM

How to solve the failure of git commit submission

How to push the specified commit How to push the specified commit Mar 06, 2025 pm 01:39 PM

How to push the specified commit

How to view commit contents How to view commit contents Mar 06, 2025 pm 01:41 PM

How to view commit contents

The difference between add and commit of git The difference between add and commit of git Mar 06, 2025 pm 01:35 PM

The difference between add and commit of git

What is git code management tool? What is git code management tool? What is git code management tool? What is git code management tool? Mar 06, 2025 pm 01:31 PM

What is git code management tool? What is git code management tool?

Tutorial on using git commit Tutorial on using git commit Mar 06, 2025 pm 01:36 PM

Tutorial on using git commit

See all articles