Skip to content

Commit a5d6fc4

Browse files
authored
Merge pull request #97159 from SnehaGunda/monitoring
Adding SP, trigger, UDF logging
2 parents 007d5fc + aeb15f9 commit a5d6fc4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

articles/cosmos-db/how-to-write-stored-procedures-triggers-udfs.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,17 @@ function tax(income) {
312312
313313
For examples of how to register and use a user-defined function, see [How to use user-defined functions in Azure Cosmos DB](how-to-use-stored-procedures-triggers-udfs.md#udfs) article.
314314
315+
## Logging
316+
317+
When using stored procedure, triggers or user-defined functions, you can log the steps using the `console.log()` command. This command will concentrate a string for debugging when `EnableScriptLogging` is set to true as shown in the following example:
318+
319+
```javascript
320+
var response = await client.ExecuteStoredProcedureAsync(
321+
document.SelfLink,
322+
new RequestOptions { EnableScriptLogging = true } );
323+
Console.WriteLine(response.ScriptLog);
324+
```
325+
315326
## Next steps
316327
317328
Learn more concepts and how-to write or use stored procedures, triggers, and user-defined functions in Azure Cosmos DB:

0 commit comments

Comments
 (0)