Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3f6f3ee7
Commit
3f6f3ee7
authored
Jul 22, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
ab9399d9
c0c3e7c7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
9 deletions
+16
-9
changelogs/unreleased/sh-make-githost-json.yml
changelogs/unreleased/sh-make-githost-json.yml
+5
-0
doc/administration/logs.md
doc/administration/logs.md
+10
-4
lib/gitlab/git_logger.rb
lib/gitlab/git_logger.rb
+1
-5
No files found.
changelogs/unreleased/sh-make-githost-json.yml
0 → 100644
View file @
3f6f3ee7
---
title
:
Convert githost.log to JSON format
merge_request
:
30967
author
:
type
:
changed
doc/administration/logs.md
View file @
3f6f3ee7
...
...
@@ -157,16 +157,22 @@ This file lives in `/var/log/gitlab/gitlab-rails/githost.log` for
Omnibus GitLab packages or in
`/home/git/gitlab/log/githost.log`
for
installations from source.
NOTE:
**Note:**
After 12.2, this file will be stored in JSON format.
GitLab has to interact with Git repositories but in some rare cases
something can go wrong and in this case you will know what exactly
happened. This log file contains all failed requests from GitLab to Git
repositories. In the majority of cases this file will be useful for developers
only. For example:
```
December 03, 2014 13:20 -> ERROR -> 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
error: failed to push some refs to '/Users/vsizov/gitlab-development-kit/repositories/gitlabhq/gitlab_git.git'
```
json
{
"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\n
error: failed to push some refs to '/Users/vsizov/gitlab-development-kit/repositories/gitlabhq/gitlab_git.git'"
}
```
## `audit_json.log`
...
...
lib/gitlab/git_logger.rb
View file @
3f6f3ee7
# frozen_string_literal: true
module
Gitlab
class
GitLogger
<
Gitlab
::
Logger
class
GitLogger
<
Json
Logger
def
self
.
file_name_noext
'githost'
end
def
format_message
(
severity
,
timestamp
,
progname
,
msg
)
"
#{
timestamp
.
to_s
(
:long
)
}
->
#{
severity
}
->
#{
msg
}
\n
"
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment