From c7ba827ae1c94f447a3c91e6349f5d30a0dd6fc9 Mon Sep 17 00:00:00 2001 From: Jason Frey Date: Fri, 15 Jan 2021 11:46:29 -0500 Subject: [PATCH] Move logger initialization and configuration into plugins --- .rubocop_local.yml | 19 ------------------- lib/vmdb/loggers.rb | 38 -------------------------------------- 2 files changed, 57 deletions(-) diff --git a/.rubocop_local.yml b/.rubocop_local.yml index f50e15ac454..679479c8e3c 100644 --- a/.rubocop_local.yml +++ b/.rubocop_local.yml @@ -5,34 +5,15 @@ AllCops: Style/GlobalVars: AllowedVariables: # Loggers - - $ansible_tower_log - $api_log - $audit_log - - $aws_log - - $azure_log - - $azure_stack_log - - $cn_monitoring_log - $container_log - - $datawarehouse_log - - $fog_log - - $gce_log - - $ibm_cloud_log - - $ibm_terraform_log - $journald_log - - $kube_log - - $lenovo_log - $log - $miq_ae_logger - - $nsxt_log - - $nuage_log - $policy_log - $rails_log - - $redfish_log - $remote_console_log - - $rhevm_log - - $scvmm_log - - $vcloud_log - - $vim_log Rails/Exit: Exclude: - lib/workers/bin/* diff --git a/lib/vmdb/loggers.rb b/lib/vmdb/loggers.rb index cac413e8438..2f00f32143e 100644 --- a/lib/vmdb/loggers.rb +++ b/lib/vmdb/loggers.rb @@ -30,25 +30,6 @@ def self.apply_config(config) apply_config_value(config, $api_log, :level_api) # TODO: Move this into the manageiq-automation_engine plugin apply_config_value(config, $miq_ae_logger, :level_automation) - # TODO: Move these to their respective provider plugins - apply_config_value(config, $ansible_tower_log, :level_ansible_tower) - apply_config_value(config, $azure_log, :level_azure) - apply_config_value(config, $azure_stack_log, :level_azure_stack) - apply_config_value(config, $cn_monitoring_log, :level_cn_monitoring) - apply_config_value(config, $datawarehouse_log, :level_datawarehouse) - apply_config_value(config, $fog_log, :level_fog) - apply_config_value(config, $gce_log, :level_gce) - apply_config_value(config, $ibm_cloud_log, :level_ibm_cloud) - apply_config_value(config, $ibm_terraform_log, :level_ibm_terraform) - apply_config_value(config, $kube_log, :level_kube) - apply_config_value(config, $lenovo_log, :level_lenovo) - apply_config_value(config, $nsxt_log, :level_nsxt) - apply_config_value(config, $nuage_log, :level_nuage) - apply_config_value(config, $redfish_log, :level_redfish) - apply_config_value(config, $rhevm_log, :level_rhevm) - apply_config_value(config, $scvmm_log, :level_scvmm) - apply_config_value(config, $vcloud_log, :level_vcloud) - apply_config_value(config, $vim_log, :level_vim) Vmdb::Plugins.each { |p| p.try(:apply_logger_config, config) } end @@ -74,25 +55,6 @@ def self.create_logger(log_file_name, logger_class = VMDBLogger) $api_log = create_logger("api.log") # TODO: Move this into the manageiq-automation_engine plugin $miq_ae_logger = create_logger("automation.log") - # TODO: Move these to their respective provider plugins - $ansible_tower_log = create_logger("ansible_tower.log") - $azure_log = create_logger("azure.log", ProviderSdkLogger) - $azure_stack_log = create_logger("azure_stack.log") - $cn_monitoring_log = create_logger("container_monitoring.log") - $datawarehouse_log = create_logger("datawarehouse.log") - $fog_log = create_logger("fog.log", FogLogger) - $gce_log = create_logger("gce.log") - $ibm_cloud_log = create_logger("ibm_cloud.log", ProviderSdkLogger) - $ibm_terraform_log = create_logger("ibm_terraform.log", ProviderSdkLogger) - $kube_log = create_logger("kubernetes.log") - $lenovo_log = create_logger("lenovo.log") - $nsxt_log = create_logger("nsxt.log") - $nuage_log = create_logger("nuage.log") - $redfish_log = create_logger("redfish.log") - $rhevm_log = create_logger("rhevm.log") - $scvmm_log = create_logger("scvmm.log") - $vcloud_log = create_logger("vcloud.log") - $vim_log = create_logger("vim.log") configure_external_loggers end