Skip to content

Commit

Permalink
Merge pull request #416 from recognizegroup/feature/20739-enable-APIM…
Browse files Browse the repository at this point in the history
…-logging-extension

Enabled extenstion of logging for APIM AB#20739
  • Loading branch information
tom-reinders authored Jul 1, 2024
2 parents 3571af1 + 35ad49a commit 027922f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 deletions.
8 changes: 4 additions & 4 deletions modules/azure/api_management/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,22 @@ resource "azurerm_api_management_diagnostic" "apim_diagnostic" {
http_correlation_protocol = var.diagnostic_settings.http_correlation_protocol

frontend_request {
body_bytes = 32
body_bytes = var.diagnostic_settings.frontend_request_body_bytes
headers_to_log = var.diagnostic_settings.headers_to_log_request
}

frontend_response {
body_bytes = 32
body_bytes = var.diagnostic_settings.frontend_response_body_bytes
headers_to_log = var.diagnostic_settings.headers_to_log_response
}

backend_request {
body_bytes = 32
body_bytes = var.diagnostic_settings.backend_request_body_bytes
headers_to_log = var.diagnostic_settings.headers_to_log_request
}

backend_response {
body_bytes = 32
body_bytes = var.diagnostic_settings.backend_response_body_bytes
headers_to_log = var.diagnostic_settings.headers_to_log_response
}
}
Expand Down
36 changes: 22 additions & 14 deletions modules/azure/api_management/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,31 @@ variable "api_management_logger_settings" {

variable "diagnostic_settings" {
type = object({
sampling_percentage = number,
always_log_errors = bool,
log_client_ip = bool,
verbosity = string, # possible values: verbose, information, error
http_correlation_protocol = string, # possible values: None, Legacy, W3C
headers_to_log_request = list(string),
headers_to_log_response = list(string)
sampling_percentage = number,
always_log_errors = bool,
log_client_ip = bool,
verbosity = string, # possible values: verbose, information, error
http_correlation_protocol = string, # possible values: None, Legacy, W3C
headers_to_log_request = list(string),
headers_to_log_response = list(string),
frontend_request_body_bytes = number,
frontend_response_body_bytes = number,
backend_request_body_bytes = number,
backend_response_body_bytes = number
})
description = "Settings for api management diagnostic, api-management-diagnostic will be created only if api_management_logger_settings have been provided. "
default = {
sampling_percentage = 5.0,
always_log_errors = true,
log_client_ip = true,
verbosity = "verbose", # possible values: verbose, information, error
http_correlation_protocol = "W3C",
headers_to_log_request = ["content-type", "accept", "origin"],
headers_to_log_response = ["content-type", "content-length", "origin"]
sampling_percentage = 5.0,
always_log_errors = true,
log_client_ip = true,
verbosity = "verbose", # possible values: verbose, information, error
http_correlation_protocol = "W3C",
headers_to_log_request = ["content-type", "accept", "origin"],
headers_to_log_response = ["content-type", "content-length", "origin"],
frontend_request_body_bytes = 32,
frontend_response_body_bytes = 32,
backend_request_body_bytes = 32,
backend_response_body_bytes = 32
}
}

Expand Down

0 comments on commit 027922f

Please sign in to comment.