Skip to content

Commit

Permalink
Adds better logging to enable troubleshooting policy factory loading
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanderhoof committed Sep 21, 2023
1 parent d79d4ad commit 9603717
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/domain/factories/create_from_policy_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def initialize(renderer: Factories::Renderer.new, http: RestClient, schema_valid
@http = http
@schema_validator = schema_validator
@utilities = utilities
@logger = Rails.logger

# JSON and URI are defined here for visibility. They are not currently
# mocked in testing, thus, we're not setting them in the initializer.
Expand Down Expand Up @@ -128,6 +129,8 @@ def render_and_apply_policy(policy_load_path:, policy_template:, variables:, acc
template: policy_template,
variables: variables
).bind do |rendered_policy|
@logger.debug("Policy Factory is applying the following policy to '/policies/#{account}/policy/#{policy_load_path}'")
@logger.debug("\n#{rendered_policy}")
begin
response = @http.post(
"http://localhost:#{ENV['PORT']}/policies/#{account}/policy/#{policy_load_path}",
Expand Down

0 comments on commit 9603717

Please sign in to comment.