Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2019-12-11 18:16:07 +0300
committerJacob Vosmaer <jacob@gitlab.com>2019-12-11 18:16:07 +0300
commit938493edda6e4d1b9a8a5122251aea744623cfe8 (patch)
tree957f47b4bb6a300e2411af4b3030e20c8fcb2766
parent671204df5ea44a512b8089e6f44452714e91fdde (diff)
parent0ba7a3ff1f6636407622058cef7c07562de9e2b3 (diff)
Merge branch 'jc-fix-structured-logging' into 'master'
Start up log messages are now using structured logging too Closes #2233 and #2185 See merge request gitlab-org/gitaly!1674
-rwxr-xr-x_support/test-boot7
-rw-r--r--changelogs/unreleased/jc-fix-structured-logging.yml5
-rw-r--r--cmd/gitaly/main.go11
3 files changed, 18 insertions, 5 deletions
diff --git a/_support/test-boot b/_support/test-boot
index 1d7b19f28..61eeeef3f 100755
--- a/_support/test-boot
+++ b/_support/test-boot
@@ -8,6 +8,13 @@ ADDR = 'socket'.freeze
def main(gitaly_dir)
gitaly_dir = File.realpath(gitaly_dir)
+ version = IO.popen("#{File.join(gitaly_dir, 'gitaly')} -version").read
+ version_from_file = "Gitaly, version #{IO.read(File.join(gitaly_dir, 'VERSION')).strip}"
+
+ # Use start_with? instead of == because the version output could use git describe, if it is a source install
+ # eg: Gitaly, version 1.75.0-14-gd1ecb43f
+ abort "\ngitaly -version failed" unless version.start_with?(version_from_file)
+
Dir.mktmpdir do |dir|
Dir.chdir(dir)
diff --git a/changelogs/unreleased/jc-fix-structured-logging.yml b/changelogs/unreleased/jc-fix-structured-logging.yml
new file mode 100644
index 000000000..7ab19ab2a
--- /dev/null
+++ b/changelogs/unreleased/jc-fix-structured-logging.yml
@@ -0,0 +1,5 @@
+---
+title: Start up log messages are now using structured logging too
+merge_request: 1674
+author:
+type: other
diff --git a/cmd/gitaly/main.go b/cmd/gitaly/main.go
index 18cc8f62c..dc6964eaa 100644
--- a/cmd/gitaly/main.go
+++ b/cmd/gitaly/main.go
@@ -46,11 +46,6 @@ func main() {
flag.Usage = flagUsage
flag.Parse()
- b, err := bootstrap.New()
- if err != nil {
- log.WithError(err).Fatal("init bootstrap")
- }
-
// If invoked with -version
if *flagVersion {
fmt.Println(version.GetVersionString())
@@ -70,6 +65,12 @@ func main() {
}
config.ConfigureLogging()
+
+ b, err := bootstrap.New()
+ if err != nil {
+ log.WithError(err).Fatal("init bootstrap")
+ }
+
sentry.ConfigureSentry(version.GetVersion(), sentry.Config(config.Config.Logging.Sentry))
config.Config.Prometheus.Configure()
config.ConfigureConcurrencyLimits()