From e900e53aa530ce15a73a4bf88cafa304999a99e9 Mon Sep 17 00:00:00 2001 From: Lukas Erlacher Date: Sat, 29 Oct 2016 17:10:41 +0200 Subject: Show log corresponding to env in admin/logs No matter which environment Gitlab was running as, the admin/logs view always showed production.log. This commit selects the logfile based on Rails.env. - Rename ProductionLogger to EnvironmentLogger - Make EnvironmentLogger logfile depend on env - Update spinach test for log tabs --- lib/gitlab/environment_logger.rb | 7 +++++++ lib/gitlab/production_logger.rb | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 lib/gitlab/environment_logger.rb delete mode 100644 lib/gitlab/production_logger.rb (limited to 'lib') diff --git a/lib/gitlab/environment_logger.rb b/lib/gitlab/environment_logger.rb new file mode 100644 index 00000000000..407cc572656 --- /dev/null +++ b/lib/gitlab/environment_logger.rb @@ -0,0 +1,7 @@ +module Gitlab + class EnvironmentLogger < Gitlab::Logger + def self.file_name_noext + Rails.env + end + end +end diff --git a/lib/gitlab/production_logger.rb b/lib/gitlab/production_logger.rb deleted file mode 100644 index 89ce7144b1b..00000000000 --- a/lib/gitlab/production_logger.rb +++ /dev/null @@ -1,7 +0,0 @@ -module Gitlab - class ProductionLogger < Gitlab::Logger - def self.file_name_noext - 'production' - end - end -end -- cgit v1.2.1