Skip to content

Commit 359ae04

Browse files
authored
Merge pull request #112709 from normesta/normesta-snippets
Testing snippet inclusion
2 parents 8df7ed7 + 708d06a commit 359ae04

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

articles/storage/common/storage-analytics-logging.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,11 @@ Set-AzureStorageServiceLoggingProperty -ServiceType Table -LoggingOperations non
153153

154154
In addition to using the Azure portal or the Azure PowerShell cmdlets to control Storage Logging, you can also use one of the Azure Storage APIs. For example, if you are using a .NET language you can use the Storage Client Library.
155155

156-
The classes **CloudBlobClient**, **CloudQueueClient**, and **CloudTableClient** all have methods such as **SetServiceProperties** and **SetServicePropertiesAsync** that take a **ServiceProperties** object as a parameter. You can use the **ServiceProperties** object to configure Storage Logging. For example, the following C# snippet shows how to change what is logged and the retention period for queue logging:
156+
# [\.NET v12 SDK](#tab/dotnet)
157+
158+
:::code language="csharp" source="~/azure-storage-snippets/queues/howto/dotnet/dotnet-v12/diagnostic-logs-classic.cs" id="snippet_EnableDiagnosticLogs":::
159+
160+
# [\.NET v11 SDK](#tab/dotnet11)
157161

158162
```csharp
159163
var storageAccount = CloudStorageAccount.Parse(connStr);
@@ -166,6 +170,9 @@ serviceProperties.Logging.RetentionDays = 2;
166170
queueClient.SetServiceProperties(serviceProperties);
167171
```
168172

173+
---
174+
175+
169176
For more information about using a .NET language to configure Storage Logging, see [Storage Client Library Reference](https://msdn.microsoft.com/library/azure/dn261237.aspx).
170177

171178
For general information about configuring Storage Logging using the REST API, see [Enabling and Configuring Storage Analytics](https://msdn.microsoft.com/library/azure/hh360996.aspx).

0 commit comments

Comments
 (0)