diff --git a/handlenett-backend/serverless/functions/ItemsChangeFeed.cs b/handlenett-backend/serverless/functions/ItemsChangeFeed.cs index 26905d7..95891cd 100644 --- a/handlenett-backend/serverless/functions/ItemsChangeFeed.cs +++ b/handlenett-backend/serverless/functions/ItemsChangeFeed.cs @@ -23,10 +23,21 @@ public void Run([CosmosDBTrigger( CreateLeaseContainerIfNotExists = true)] IReadOnlyList input) { - if (input != null && input.Count > 0) + try { - _logger.LogInformation("Documents modified: " + input.Count); - _logger.LogInformation("First document Id: " + input[0].id); + if (input != null && input.Count > 0) + { + _logger.LogInformation("Documents modified: " + input.Count); + _logger.LogInformation("First document Id: " + input[0].id); + } + else + { + _logger.LogInformation("Input was null or empty."); + } + } + catch (Exception ex) + { + _logger.LogError(ex, "An error occurred while processing the Cosmos DB trigger."); } } } diff --git a/handlenett-backend/serverless/functions/host.json b/handlenett-backend/serverless/functions/host.json index 097f524..7650524 100644 --- a/handlenett-backend/serverless/functions/host.json +++ b/handlenett-backend/serverless/functions/host.json @@ -7,8 +7,7 @@ }, "applicationInsights": { "samplingSettings": { - "isEnabled": true, - "excludedTypes": "Request" + "isEnabled": false } } }