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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer (GitLab) <jacob@gitlab.com>2017-10-03 14:28:40 +0300
committerRémy Coutable <remy@rymai.me>2017-10-03 14:28:40 +0300
commit2e76c604dfad0e44adf177795c576255c85b3171 (patch)
tree3e04bc3ce4b3a1ed4a6470020e32699de9431626 /config/initializers/grpc.rb
parentae9dd4b55248f33b36425c99d46532c945632cdc (diff)
Add grpc.log for Gitaly
Diffstat (limited to 'config/initializers/grpc.rb')
-rw-r--r--config/initializers/grpc.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/config/initializers/grpc.rb b/config/initializers/grpc.rb
new file mode 100644
index 00000000000..b96962fe7db
--- /dev/null
+++ b/config/initializers/grpc.rb
@@ -0,0 +1,11 @@
+require 'logger'
+
+GRPC_LOGGER = Logger.new(Rails.root.join('log/grpc.log'))
+GRPC_LOGGER.level = ENV['GRPC_LOG_LEVEL'].presence || 'WARN'
+GRPC_LOGGER.progname = 'GRPC'
+
+module GRPC
+ def self.logger
+ GRPC_LOGGER
+ end
+end