DEV: add site setting to enable debugging.

DEV: add site setting to enable debugging.

diff --git a/app/controllers/discourse_prometheus_alert_receiver/receiver_controller.rb b/app/controllers/discourse_prometheus_alert_receiver/receiver_controller.rb
index 1c7fa48..5a6a81a 100644
--- a/app/controllers/discourse_prometheus_alert_receiver/receiver_controller.rb
+++ b/app/controllers/discourse_prometheus_alert_receiver/receiver_controller.rb
@@ -54,6 +54,8 @@ module DiscoursePrometheusAlertReceiver
     def receive
       find_receiver_from_token
 
+      log("Alert: #{params.inspect}")
+
       Jobs.enqueue(:process_alert,
         token: @token,
         params: params.permit!.to_h
@@ -65,6 +67,8 @@ module DiscoursePrometheusAlertReceiver
     def receive_grouped_alerts
       find_receiver_from_token
 
+      log("Grouped Alert: #{params.inspect}")
+
       Jobs.enqueue(:process_grouped_alerts,
         token: @token,
         data: params[:data].to_json,
@@ -91,5 +95,9 @@ module DiscoursePrometheusAlertReceiver
       category = Category.find_by(id: @receiver[:category_id])
       raise Discourse::InvalidParameters unless category
     end
+
+    def log(info)
+      Rails.logger.warn("Prometheus Alerts Debugging: #{info}") if SiteSetting.prometheus_alert_receiver_debug_enabled
+    end
   end
 end
diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml
index 958aa5d..785b8d3 100644
--- a/config/locales/server.en.yml
+++ b/config/locales/server.en.yml
@@ -4,6 +4,7 @@ en:
     prometheus_alert_receiver_opsgenie_api_key: "OpsGenie integrations API key to fetch schedules which will be used for assigning alerts"
     prometheus_alert_receiver_custom_nav_group: "Group that should see the top nav item for open alerts (leave blank to include for everyone)"
     prometheus_alert_receiver_enable_assign: "Enable the assignment of new topics"
+    prometheus_alert_receiver_debug_enabled: "Enable debugging for prometheus alert receiver"
   prom_alert_receiver:
     post:
       headers:
diff --git a/config/settings.yml b/config/settings.yml
index e76adf9..c2ea6c0 100644
--- a/config/settings.yml
+++ b/config/settings.yml
@@ -6,3 +6,4 @@ plugins:
     type: list
     list_type: compact
   prometheus_alert_receiver_enable_assign: true
+  prometheus_alert_receiver_debug_enabled: false

GitHub sha: 78b67b16