diff --git a/lib/vmdb/loggers.rb b/lib/vmdb/loggers.rb index 4adb7757410..b19cc4574ce 100644 --- a/lib/vmdb/loggers.rb +++ b/lib/vmdb/loggers.rb @@ -56,7 +56,8 @@ def self.create_logger(log_file_name, logger_class = ManageIQ::Loggers::Base) end private_class_method def self.create_container_logger(log_file_name, logger_class) - return nil unless (logger = create_raw_container_logger) + require "manageiq/loggers/container" + logger = ManageIQ::Loggers::Container.new progname = progname_from_file(log_file_name) logger.progname = progname @@ -64,13 +65,9 @@ def self.create_logger(log_file_name, logger_class = ManageIQ::Loggers::Base) create_wrapper_logger(progname, logger_class, logger) end - private_class_method def self.create_raw_container_logger - require "manageiq/loggers/container" - ManageIQ::Loggers::Container.new - end - private_class_method def self.create_journald_logger(log_file_name, logger_class) - return nil unless (logger = create_raw_journald_logger) + require "manageiq/loggers/journald" + logger = ManageIQ::Loggers::Journald.new progname = progname_from_file(log_file_name) logger.progname = progname @@ -78,13 +75,6 @@ def self.create_logger(log_file_name, logger_class = ManageIQ::Loggers::Base) create_wrapper_logger(progname, logger_class, logger) end - private_class_method def self.create_raw_journald_logger - require "manageiq/loggers/journald" - ManageIQ::Loggers::Journald.new - rescue LoadError - nil - end - private_class_method def self.log_path_from_file(log_file) log_file = Pathname.new(log_file) if log_file.kind_of?(String) log_file = ManageIQ.root.join("log", log_file) if log_file.try(:dirname).to_s == "."