InnerDrive.Logging 5.2.1247.1

dotnet add package InnerDrive.Logging --version 5.2.1247.1
                    
NuGet\Install-Package InnerDrive.Logging -Version 5.2.1247.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="InnerDrive.Logging" Version="5.2.1247.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="InnerDrive.Logging" Version="5.2.1247.1" />
                    
Directory.Packages.props
<PackageReference Include="InnerDrive.Logging" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add InnerDrive.Logging --version 5.2.1247.1
                    
#r "nuget: InnerDrive.Logging, 5.2.1247.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package InnerDrive.Logging@5.2.1247.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=InnerDrive.Logging&version=5.2.1247.1
                    
Install as a Cake Addin
#tool nuget:?package=InnerDrive.Logging&version=5.2.1247.1
                    
Install as a Cake Tool

Inner Drive Extensible Architeture

The Inner Drive Extensible Architecture implements common .NET development situations including time zones, money, measurements and conversions, and Microsoft Azure features.

InnerDrive.Logging

Features

  • Microsoft Azure-based event and audit logging capabiliites
  • Abstraction layers for sending email through Postmark and SendGrid
  • NLog targets for SendGrid, Postmark, and Azure tables

Prerequisites

This package runs on .NET 8. It depends on these packages:

To use the Azure logging tools, you will need an Azure subscription and connection string to an Azure tables instance. To use Postmark email tools, you will need a Postmark subscription. To use SendGrid, you'll need a Twilio SendGrid subscription, which you can sign up for through the Azure portal.

Usage

To use the ActionLog

Configure the actionLog and Azure Key Vault settings:

{
	"actionLog": {
		"baseTableName": "myAppLog"
	},
	"keyVaultSecretProviderThrowExceptions": true,
	"keyVaultTenantId": "{key vault tenant ID}",
	"keyVaultUrl": "{key vault URL}"
}

The Key Vault Secrets collection should contain the following:

  • storageAccountKey
  • storageAccountName
  • storageTablesUri
  • storageConnectionString

Once set up, adding an event is straightforward:

var repository = new AzureLogRepository(_accountName, _accountKey, _tablesUri)
{
	ApplicationName = ApplicationName,
	BaseTableName = BaseTableName,
	Source = "AzureLogRepository.Write example"
};
var eventInfo = new LogEventInfo(LogLevel.Info, GetType().Name, messageBody)
{
	Properties =
	{
		["Computer name"] = Environment.MachineName,
		["OS Version"] = Environment.OSVersion.ToString()
	}
};
var logEntry = AzureLogEntry.Map(eventInfo, ApplicationName);

var result = await repository.WriteAsync(logEntry, CancellationToken.None);
Trace.WriteLine($"Async write result: {result.Status}");

Reading log entries is also easy:

var now = DateTimeOffset.Now;
var range = new DateRange(now.AddHours(-24), now);
var result = await repository.FindAsync(range);
foreach(var item in result)
{
	Trace.WriteLine(item);
}

NLog targets

NLog.config settings:

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      autoReload="true"
      internalLogLevel="Info"
      internalLogFile="c:\temp\internal-nlog.txt"
      throwExceptions="true"
      throwConfigExceptions="true">

	<extensions>
		<add assembly="InnerDrive.Logging"/>
	</extensions>
	
	<targets async="false">
		<target name="logconsole" xsi:type="Console" />
		<target name="logfile" xsi:type="File" fileName="c:\Temp\nlog-all-${shortdate}.txt"
		        layout="${longdate}|${event-properties:item=EventId_Id}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}"/>
		<target xsi:type="AzureTableTarget"
			name="azureTable"
			applicationName="Logging.Test"
			baseTableName="InnerDriveLogTest"
		/>
		<target xsi:type="PostmarkTarget"
			name="postmark"
			applicationName="Logging.Test via Postmark"
			from="noreply@inner-drive.com"
			subject="NLog Postmark target"
			to="nerdly@contoso.org"
		/>
		<target xsi:type="SendGridTarget"
			name="sendgrid"
			applicationName="Logging.Test via SendGrid"
			from="noreply@inner-drive.com"
			subject="NLog SendGrid target"
			to="nerdly@contoso.org"
		/>
	</targets>
	
	<rules>
		<logger name="*" minlevel="Fatal" writeto="postmark,sendgrid" />
		<logger name="*" minlevel="Warn" writeTo="azureTable" />
		<logger name="*" minlevel="Info" writeTo="logfile" />
		<logger name="*" minlevel="Debug" writeTo="logconsole" />
	</rules>
</nlog>

The Inner Drive Technology website has a full SDK and example code. We also have a demo weather site that uses all the IDEA components.

Feedback

Comments or questions? Send feedback

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.2.1247.1 85 10/12/2025
5.2.1235.1 162 10/5/2025
5.2.1076.1 579 2/14/2025
5.2.989.1 302 11/2/2024
5.2.938.1 322 9/7/2024
5.1.926.1 183 9/2/2024
5.1.871.1 352 6/6/2024
5.1.854.1 298 5/21/2024
5.1.844.1 355 3/27/2024
5.0.826.1 436 1/6/2024
5.0.816.1 251 12/24/2023
5.0.801.1 305 11/26/2023
5.0.777.1 321 9/28/2023
5.0.754.1 390 8/5/2023
5.0.746.1 320 7/15/2023
5.0.706.1 369 4/15/2023
5.0.693.1 530 3/22/2023
4.2.646.1 1,297 6/23/2022
4.2.628.1 700 6/1/2022
4.2.622.1 633 5/24/2022
4.2.619.1 612 5/18/2022
4.2.617.1 611 5/17/2022
4.2.586.1 845 3/27/2022
4.1.387.1 863 4/17/2021
4.0.234.1 643 11/12/2020

Multiple performance and stability improvements