You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-monitor/app/asp-net-trace-logs.md
+19-2Lines changed: 19 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,9 +15,9 @@ ms.date: 05/08/2019
15
15
ms.author: mbullwin
16
16
17
17
---
18
-
# Explore .NET/.NET Core trace logs in Application Insights
18
+
# Explore .NET/.NET Core and Python trace logs in Application Insights
19
19
20
-
Send diagnostic tracing logs for your ASP.NET/ASP.NET Core application from ILogger, NLog, log4Net, or System.Diagnostics.Trace to [Azure Application Insights][start]. You can then explore and search them. Those logs are merged with the other log files from your application, so you can identify traces that are associated with each user request and correlate them with other events and exception reports.
20
+
Send diagnostic tracing logs for your ASP.NET/ASP.NET Core application from ILogger, NLog, log4Net, or System.Diagnostics.Trace to [Azure Application Insights][start]. For Python applications, send diagnostic tracing logs using AzureLogHandler in OpenCensus Python for Azure Monitor. You can then explore and search them. Those logs are merged with the other log files from your application, so you can identify traces that are associated with each user request and correlate them with other events and exception reports.
21
21
22
22
> [!NOTE]
23
23
> Do you need the log-capture module? It's a useful adapter for third-party loggers. But if you aren't already using NLog, log4Net, or System.Diagnostics.Trace, consider just calling [**Application Insights TrackTrace()**](../../azure-monitor/app/api-custom-events-metrics.md#tracktrace) directly.
@@ -152,6 +152,23 @@ You can also add a severity level to your message. And, like other telemetry, yo
152
152
153
153
This would enable you to easily filter out in [Search][diagnostic] all the messages of a particular severity level that relate to a particular database.
154
154
155
+
## AzureLogHandler for OpenCensus Python
156
+
The Azure Monitor Log Handler allows you to export Python logs to Azure Monitor.
157
+
158
+
Instrument your application with the [OpenCensus Python SDK](../../azure-monitor/app/opencensus-python.md) for Azure Monitor.
159
+
160
+
This example shows how to send a warning level log to Azure Monitor.
161
+
162
+
```python
163
+
import logging
164
+
165
+
from opencensus.ext.azure.log_exporter import AzureLogHandler
0 commit comments