EGC.MLog.Client 1.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package EGC.MLog.Client --version 1.0.4
NuGet\Install-Package EGC.MLog.Client -Version 1.0.4
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="EGC.MLog.Client" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EGC.MLog.Client --version 1.0.4
#r "nuget: EGC.MLog.Client, 1.0.4"
#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.
// Install EGC.MLog.Client as a Cake Addin
#addin nuget:?package=EGC.MLog.Client&version=1.0.4

// Install EGC.MLog.Client as a Cake Tool
#tool nuget:?package=EGC.MLog.Client&version=1.0.4

Usage example

// ...

static void Main(string[] args)
{
	// Get certificate from store
	var certificate = GetCertificate(StoreLocation.LocalMachine, X509FindType.FindBySubjectName, "organization.pki.gov.md");
	// Initialize MLogClient
	var client = new MLogClient(new Uri("https://{{ host }}:{{ port }}"), certificate);
	// Create new MLogEvent
	var @event = new MLogEvent("event.type");
	// Set the event proeprties
	@event.Subject = new []{ "Subject 1", "Subject 2"};
	// ...

	// Register event in MLog
	var response = client.RegisterEvent(@event);

	// Display register result
	Console.WriteLine("MLog register event response: {0}", response);

	Console.WriteLine("Press [ENTER] to close this window.");
	Console.Read();
}

private static X509Certificate2 GetCertificate(StoreLocation storeLocation, X509FindType findType, string findValue)
{
	using (var store = new X509Store(StoreName.My, storeLocation))
	{
		store.Open(OpenFlags.ReadOnly);
		var certificates = store.Certificates.Find(findType, findValue, true);
		if (certificates.Count == 0)
		{
			throw new OperationCanceledException($"Cannot find certificates with criteria: {findType} = {findValue}");
		}
		return certificates[0];
	}
}
Product Compatible and additional computed target framework versions.
.NET Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on EGC.MLog.Client:

Package Downloads
EGC.MLog.Client.NLog

MLog target for NLog (.NET Framework)

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.0 1,569 6/7/2018
1.1.0 1,431 4/20/2018
1.0.4 1,304 1/10/2018
1.0.3 1,512 1/4/2018

First release