Skip to content

Commit e50c09b

Browse files
committed
adding log level information
1 parent 687b584 commit e50c09b

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

articles/cosmos-db/sql/how-to-configure-cosmos-db-trigger.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to configure logging and connection policy used by Azure
44
author: ealsur
55
ms.service: cosmos-db
66
ms.topic: how-to
7-
ms.date: 10/04/2021
7+
ms.date: 05/09/2022
88
ms.author: maquaran
99
---
1010

@@ -29,14 +29,33 @@ To enable logging when using Azure Functions trigger for Cosmos DB, locate the `
2929
"logging": {
3030
"fileLoggingMode": "always",
3131
"logLevel": {
32-
"Host.Triggers.CosmosDB": "Trace"
32+
"Host.Triggers.CosmosDB": "Warning"
3333
}
3434
}
3535
}
3636
```
3737

3838
After the Azure Function is deployed with the updated configuration, you will see the Azure Functions trigger for Cosmos DB logs as part of your traces. You can view the logs in your configured logging provider under the *Category* `Host.Triggers.CosmosDB`.
3939

40+
### Which type of logs are exposed?
41+
42+
Once enabled, there three levels of log events that will be emitted:
43+
44+
* Error:
45+
* When there is an unknown or critical error on the Change Feed processing that is affecting the correct trigger functionality.
46+
47+
* Warning:
48+
* When your Function user code had an unhandled exception. This means there is a gap in your Function code and the Function is not [resilient to errors](../../azure-functions/performance-reliability.md#write-defensive-functions) or a serialization error (for C# Functions, the raw json cannot be deserialized to the selected C# type).
49+
* When there are transient connectivity issues preventing the trigger from interacting with the Cosmos DB account. The trigger will retry these [transient connectivity errors](troubleshoot-dot-net-sdk-request-timeout.md) but if they extend for a long period of time, there could be a network problem. You can enable Debug level traces to obtain the Diagnostics from the underlying Cosmos DB SDK.
50+
51+
* Debug:
52+
* When a lease is acquired by an instance - This means the current instance will start processing the Change Feed for the lease.
53+
* When a lease is released by an instance - This means the current instance has stopped processing the Change Feed for the lease.
54+
* When new changes are delivered from the trigger to your Function code - Helps debug situations when your Function code might be having errors and you are not sure if you are receiving changes or not.
55+
* For traces that are Warning and Error, adds the Diagnostics information from the underlying Cosmos DB SDK for troubleshooting purposes.
56+
57+
You can also [refer to the source code](https://github.com/Azure/azure-webjobs-sdk-extensions/blob/dev/src/WebJobs.Extensions.CosmosDB/Trigger/CosmosDBTriggerHealthMonitor.cs) to see the full details.
58+
4059
### Query the logs
4160

4261
Run the following query to query the logs generated by the Azure Functions trigger for Cosmos DB in [Azure Application Insights' Analytics](../../azure-monitor/logs/log-query-overview.md):

0 commit comments

Comments
 (0)