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
8e20e899
Commit
8e20e899
authored
Dec 23, 2019
by
Ash McKenzie
Committed by
Douglas Barbosa Alexandre
Jan 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include current host string for all log entries
parent
ab2403e3
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
15 additions
and
1 deletion
+15
-1
changelogs/unreleased/35552-improve-logging-of-sync-services-alt.yml
...unreleased/35552-improve-logging-of-sync-services-alt.yml
+5
-0
ee/lib/gitlab/geo/log_cursor/logger.rb
ee/lib/gitlab/geo/log_cursor/logger.rb
+1
-0
ee/lib/gitlab/geo/log_helpers.rb
ee/lib/gitlab/geo/log_helpers.rb
+1
-0
ee/spec/lib/gitlab/geo/log_cursor/lease_spec.rb
ee/spec/lib/gitlab/geo/log_cursor/lease_spec.rb
+1
-0
ee/spec/lib/gitlab/geo/log_cursor/logger_spec.rb
ee/spec/lib/gitlab/geo/log_cursor/logger_spec.rb
+2
-1
ee/spec/lib/gitlab/geo/log_helpers_spec.rb
ee/spec/lib/gitlab/geo/log_helpers_spec.rb
+2
-0
ee/spec/services/geo/cache_invalidation_event_store_spec.rb
ee/spec/services/geo/cache_invalidation_event_store_spec.rb
+1
-0
ee/spec/services/geo/job_artifact_deleted_event_store_spec.rb
...pec/services/geo/job_artifact_deleted_event_store_spec.rb
+1
-0
ee/spec/services/geo/lfs_object_deleted_event_store_spec.rb
ee/spec/services/geo/lfs_object_deleted_event_store_spec.rb
+1
-0
No files found.
changelogs/unreleased/35552-improve-logging-of-sync-services-alt.yml
0 → 100644
View file @
8e20e899
---
title
:
'
Geo:
Include
host
when
logging'
merge_request
:
22203
author
:
type
:
other
ee/lib/gitlab/geo/log_cursor/logger.rb
View file @
8e20e899
...
...
@@ -52,6 +52,7 @@ module Gitlab
def
base_log_data
(
message
,
params
=
{})
{
pid:
PID
,
host:
Gitlab
.
config
.
gitlab
.
host
,
class:
caller_name
,
message:
message
}.
merge
(
params
)
...
...
ee/lib/gitlab/geo/log_helpers.rb
View file @
8e20e899
...
...
@@ -23,6 +23,7 @@ module Gitlab
def
base_log_data
(
message
)
{
class:
self
.
class
.
name
,
host:
Gitlab
.
config
.
gitlab
.
host
,
message:
message
,
job_id:
get_sidekiq_job_id
}.
merge
(
extra_log_data
).
compact
...
...
ee/spec/lib/gitlab/geo/log_cursor/lease_spec.rb
View file @
8e20e899
...
...
@@ -29,6 +29,7 @@ describe Gitlab::Geo::LogCursor::Lease, :clean_gitlab_redis_shared_state do
expect
(
::
Gitlab
::
Logger
).
to
receive
(
:debug
).
with
(
pid:
111
,
class:
'Gitlab::Geo::LogCursor::Lease'
,
host:
"localhost"
,
message:
'Lease renewed.'
)
described_class
.
renew!
...
...
ee/spec/lib/gitlab/geo/log_cursor/logger_spec.rb
View file @
8e20e899
...
...
@@ -7,7 +7,7 @@ describe Gitlab::Geo::LogCursor::Logger, :geo do
subject
(
:logger
)
{
described_class
.
new
(
LoggerSpec
)
}
let
(
:data
)
{
{
pid:
111
,
class:
'LoggerSpec'
,
message:
'Test'
}
}
let
(
:data
)
{
{
pid:
111
,
class:
'LoggerSpec'
,
host:
'localhost'
,
message:
'Test'
}
}
before
do
stub_const
(
"
#{
described_class
.
name
}
::PID"
,
111
)
...
...
@@ -35,6 +35,7 @@ describe Gitlab::Geo::LogCursor::Logger, :geo do
it
'logs an info event'
do
expect
(
::
Gitlab
::
Logger
).
to
receive
(
:info
).
with
(
pid:
111
,
class:
"LoggerSpec"
,
host:
'localhost'
,
message:
'Test'
,
cursor_delay_s:
0.0
)
...
...
ee/spec/lib/gitlab/geo/log_helpers_spec.rb
View file @
8e20e899
...
...
@@ -23,6 +23,7 @@ describe Gitlab::Geo::LogHelpers do
context
'Sidekiq context'
do
it
'does not log empty job_id when running outside of job'
do
expect
(
Gitlab
::
Geo
::
Logger
).
to
receive
(
:error
).
with
({
class:
'FakeLogHelpersConsumer'
,
host:
'localhost'
,
message:
'Test message'
})
FakeLogHelpersConsumer
.
new
.
execute
...
...
@@ -30,6 +31,7 @@ describe Gitlab::Geo::LogHelpers do
it
'logs sidekiq_context'
do
expect
(
Gitlab
::
Geo
::
Logger
).
to
receive
(
:error
).
with
({
class:
'FakeLogHelpersConsumer'
,
host:
'localhost'
,
message:
'Test message'
,
job_id:
'5b9b108c7558fe3c32cc61a5'
})
...
...
ee/spec/services/geo/cache_invalidation_event_store_spec.rb
View file @
8e20e899
...
...
@@ -30,6 +30,7 @@ describe Geo::CacheInvalidationEventStore do
expected_message
=
{
class:
described_class
.
name
,
host:
"localhost"
,
cache_key:
''
,
message:
'Cache invalidation event could not be created'
,
error:
"Validation failed: Key can't be blank"
...
...
ee/spec/services/geo/job_artifact_deleted_event_store_spec.rb
View file @
8e20e899
...
...
@@ -37,6 +37,7 @@ describe Geo::JobArtifactDeletedEventStore do
expected_message
=
{
class:
"Geo::JobArtifactDeletedEventStore"
,
host:
"localhost"
,
job_artifact_id:
invalid_job_artifact
.
id
,
file_path:
nil
,
project_id:
project
.
id
,
...
...
ee/spec/services/geo/lfs_object_deleted_event_store_spec.rb
View file @
8e20e899
...
...
@@ -37,6 +37,7 @@ describe Geo::LfsObjectDeletedEventStore do
expected_message
=
{
class:
"Geo::LfsObjectDeletedEventStore"
,
host:
"localhost"
,
lfs_object_id:
invalid_lfs_object
.
id
,
file_path:
nil
,
message:
"Lfs object deleted event could not be created"
,
...
...
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