All Projects → microsoft → Applicationinsights Dotnet Logging

microsoft / Applicationinsights Dotnet Logging

Licence: mit
.NET Logging adaptors

Projects that are alternatives of or similar to Applicationinsights Dotnet Logging

Applicationinsights Dotnet
ApplicationInsights-dotnet
Stars: ✭ 367 (+267%)
Mutual labels:  azure, sdk, monitoring, logging, telemetry, application-insights
Applicationinsights Php
Azure Application Insights SDK for PHP
Stars: ✭ 98 (-2%)
Mutual labels:  azure, sdk, monitoring, logging, telemetry, application-insights
Applicationinsights Home
Application Insights main repository for documentation of overall SDK offerings for all platforms.
Stars: ✭ 221 (+121%)
Mutual labels:  azure, sdk, monitoring, logging, telemetry, application-insights
Applicationinsights Python
Application Insights SDK for Python
Stars: ✭ 114 (+14%)
Mutual labels:  sdk, monitoring, logging, telemetry, application-insights
Applicationinsights Go
Microsoft Application Insights SDK for Go
Stars: ✭ 113 (+13%)
Mutual labels:  azure, monitoring, logging, telemetry, application-insights
Applicationinsights Dotnet Server
Microsoft Application Insights for .NET Web Applications
Stars: ✭ 130 (+30%)
Mutual labels:  azure, sdk, monitoring, telemetry, application-insights
Applicationinsights Node.js
Microsoft Application Insights SDK for Node.js
Stars: ✭ 229 (+129%)
Mutual labels:  azure, sdk, monitoring, logging, application-insights
Applicationinsights Aspnetcore
ASP.NET Core web applications monitoring
Stars: ✭ 306 (+206%)
Mutual labels:  azure, monitoring, telemetry, application-insights
Applicationinsights Java
Application Insights for Java
Stars: ✭ 172 (+72%)
Mutual labels:  azure, sdk, monitoring, application-insights
Applicationinsights Js
Microsoft Application Insights SDK for JavaScript
Stars: ✭ 462 (+362%)
Mutual labels:  azure, sdk, monitoring, application-insights
Azuremonitoringhackathon
Operationalize Azure deployments with Azure platform tools​
Stars: ✭ 46 (-54%)
Mutual labels:  azure, monitoring, application-insights
Sysmontools
Utilities for Sysmon
Stars: ✭ 903 (+803%)
Mutual labels:  monitoring, logging
Dnn.appinsights
A module to use Visual Studio Application Insights with the DNN Platform (formerly DotNetNuke) CMS
Stars: ✭ 12 (-88%)
Mutual labels:  monitoring, application-insights
Azure Grafana Dashboard Templates
Grafana dashboard templates for Azure
Stars: ✭ 31 (-69%)
Mutual labels:  azure, monitoring
Zmonitor
Azure Multi-subscription/tenant Monitoring Solution
Stars: ✭ 35 (-65%)
Mutual labels:  azure, monitoring
Logbook
An extensible Java library for HTTP request and response logging
Stars: ✭ 822 (+722%)
Mutual labels:  monitoring, logging
Nlog.xlogger
A C# .NET class library that extends NLog.Logger to provide additional functionality for tracing the entry and exit, arbitrary checkpoints, exceptions and stack traces within methods.
Stars: ✭ 31 (-69%)
Mutual labels:  logging, nlog
Infra Integrations Sdk
New Relic Infrastructure Integrations SDK
Stars: ✭ 42 (-58%)
Mutual labels:  sdk, monitoring
Llama
Library for testing and measuring network loss and latency between distributed endpoints.
Stars: ✭ 47 (-53%)
Mutual labels:  monitoring, telemetry
Splat
Makes things cross-platform
Stars: ✭ 753 (+653%)
Mutual labels:  logging, nlog

This repo is in the process of being migrated

Please pardon our progress... We are currently in the process of consolidating our github repos. See https://github.com/microsoft/ApplicationInsights-dotnet/issues/1214

Build codecov.io

Nuget packages

Application Insights logging adapters.

If you use NLog, log4Net or System.Diagnostics.Trace for diagnostic tracing in your application, you can have your logs sent to Application Insights, where you can explore and search them. Your logs will be merged with the other telemetry coming from your application, so that you can identify the traces associated with servicing each user request, and correlate them with other events and exception reports.

Read more:

ILogger

See this.

NLog

Application Insights NLog Target nuget package adds ApplicationInsights target in your web.config.

If your application does not have web.config then it can also be configured manually.

  • Configure ApplicationInsightsTarget using NLog.config :
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <extensions>
		<add assembly="Microsoft.ApplicationInsights.NLogTarget" />
    </extensions>
	<targets>
		<target xsi:type="ApplicationInsightsTarget" name="aiTarget">
			<instrumentationKey>Your_Resource_Key</instrumentationKey>	<!-- Only required if not using ApplicationInsights.config -->
			<contextproperty name="threadid" layout="${threadid}" />	<!-- Can be repeated with more context -->
		</target>
	</targets>
	<rules>
		<logger name="*" minlevel="Trace" writeTo="aiTarget" />
	</rules>
</nlog>
// You need this only if you did not define InstrumentationKey in ApplicationInsights.config (Or in the NLog.config)
TelemetryConfiguration.Active.InstrumentationKey = "Your_Resource_Key";

Logger logger = LogManager.GetLogger("Example");

logger.Trace("trace log message");
  • Configure ApplicationInsightsTarget using NLog Config API : If you configure NLog programmatically with the NLog Config API, then create Application Insights target in code and add it to your other targets:
var config = new LoggingConfiguration();

ApplicationInsightsTarget target = new ApplicationInsightsTarget();
// You need this only if you did not define InstrumentationKey in ApplicationInsights.config or want to use different instrumentation key
target.InstrumentationKey = "Your_Resource_Key";

LoggingRule rule = new LoggingRule("*", LogLevel.Trace, target);
config.LoggingRules.Add(rule);

LogManager.Configuration = config;

Logger logger = LogManager.GetLogger("Example");

logger.Trace("trace log message");

Log4Net

Application Insights Log4Net adapter nuget modifies web.config and adds Application Insights Appender.

For more information, see Log4Net Configuration

// You do not need this if you have instrumentation key in the ApplicationInsights.config
TelemetryConfiguration.Active.InstrumentationKey = "Your_Resource_Key";

log4net.Config.XmlConfigurator.Configure();
var logger = LogManager.GetLogger(this.GetType());

logger.Info("Message");
logger.Warn("A warning message");
logger.Error("An error message");

System.Diagnostics

Microsoft.ApplicationInsights.TraceListener nuget package modifies web.config and adds application insights listener.

For more information, see "Microsoft Docs: "Tracing and Instrumenting Applications"

<configuration>
  <system.diagnostics>
    <trace>
      <listeners>
        <add name="myAppInsightsListener" type="Microsoft.ApplicationInsights.TraceListener.ApplicationInsightsTraceListener, Microsoft.ApplicationInsights.TraceListener" />
      </listeners>
    </trace>
  </system.diagnostics>
</configuration>

If your application type does not have web.config, add listener programmatically or in the configuration file appropriate to your application type

// You do not need this if you have instrumentation key in the ApplicationInsights.config
TelemetryConfiguration.Active.InstrumentationKey = "Your_Resource_Key";
System.Diagnostics.Trace.TraceWarning("Slow response - database01");

EventSource

EventSourceTelemetryModule allows you to configure EventSource events to be sent to Application Insights as traces.

For more information, see Microsoft Docs: "Using EventSource Events".

ETW

EtwCollectorTelemetryModule allows you to configure events from ETW providers to be sent to Application Insights as traces.

For more information, see Microsoft Docs: "Using ETW Events".

DiagnosticSource

You can configure System.Diagnostics.DiagnosticSource events to be sent to Application Insights as traces.

For more information, see CoreFX: "Diagnostic Source Users Guide".

To enable, edit the TelemetryModules section of the ApplicationInsights.config file:

<Add Type="Microsoft.ApplicationInsights.DiagnosticSourceListener.DiagnosticSourceTelemetryModule, Microsoft.ApplicationInsights.DiagnosticSourceListener">
      <Sources>
        <Add Name="MyDiagnosticSourceName" />
      </Sources>
 </Add>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].