Merchants.Common.Logging
1.0.0
See the version list below for details.
dotnet add package Merchants.Common.Logging --version 1.0.0
NuGet\Install-Package Merchants.Common.Logging -Version 1.0.0
<PackageReference Include="Merchants.Common.Logging" Version="1.0.0" />
paket add Merchants.Common.Logging --version 1.0.0
#r "nuget: Merchants.Common.Logging, 1.0.0"
// Install Merchants.Common.Logging as a Cake Addin #addin nuget:?package=Merchants.Common.Logging&version=1.0.0 // Install Merchants.Common.Logging as a Cake Tool #tool nuget:?package=Merchants.Common.Logging&version=1.0.0
Merchants Common Logging library
Introduction
Provides a simple logging abstraction to switch between different logging implementations. There is current support for NLog and Microsoft Application Insights.In furture will enhnace this libraray to add more support.
Additionally Common.Logging comes with a set of base classes making the integration of any log system a breeze.
NLog Quickstart
This demonstrates how to configure your app to log using the built in Merchants.Common.Logging.
1) Install Merchants.Common.Logging via NuGet
Either open the Package Management Console and enter the following or use the built-in GUI
NuGet: PM> Install-Package Merchants.Common.Logging
add "nlog.config" file to your project directory. sample nlog.config
<?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">
<extensions>
<add assembly="NLog.Web.AspNetCore"/>
</extensions>
<targets>
<target xsi:type="File" name="allfile" fileName="${basedir}/Logs/debug-log-${shortdate}.log"
layout="${longdate}|${event-properties:item=EventId_Id}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}" />
</targets>
<rules>
<logger name="*" minlevel="Trace" writeTo="allfile" />
<logger name="Microsoft.*" maxlevel="Info" final="true" />
</rules>
</nlog>
Application Insights Quickstart
PM> Install-Package Merchants.Common.Logging
The app config should then have an Application Insights section like below. Be sure to set the InstrumentationKey with your InstrumentationKey retrieved from Application Insights portal https://portal.azure.com.
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
},
"ApplicationInsights": {
"InstrumentationKey": ""
}
}
Solution Layout
Building
- Clone the GitHub repository
- Install Silverlight SDK 5
- [Optional] Install Java for the documentation builder
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.ApplicationInsights.AspNetCore (>= 2.13.1)
- Newtonsoft.Json (>= 12.0.3)
- NLog (>= 4.7.0)
- NLog.Web.AspNetCore (>= 4.9.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.