EGC.MLog.Client.NLog
1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package EGC.MLog.Client.NLog --version 1.0.0
NuGet\Install-Package EGC.MLog.Client.NLog -Version 1.0.0
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.NLog" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EGC.MLog.Client.NLog --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EGC.MLog.Client.NLog, 1.0.0"
#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.NLog as a Cake Addin #addin nuget:?package=EGC.MLog.Client.NLog&version=1.0.0 // Install EGC.MLog.Client.NLog as a Cake Tool #tool nuget:?package=EGC.MLog.Client.NLog&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Logger example
// ...
private static readonly Logger log = LogManager.GetLogger("mlog");
static void Main(string[] args)
{
log.Info().Message("Log message")
.Property("event_type", "event.type") // event_type is required
// MLog.Client.NLog.MLogExtensions class provide a list of extensions set MLog properties in a easy way
.Subject("Single subject")
.Write();
Console.WriteLine("Press [ENTER] to close this window.");
Console.Read();
}
Configurations example
<nlog internalLogFile="d:\temp\app-nlog.log" xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<extensions>
<add assembly="MLog.Client.NLog"/>
</extensions>
<variable name="event-type-prefix" value="my.app"/>
<targets>
<target
name="mlogTarget"
type="MLog"
certificateLocationStore="LocalMachine"
certificateFindType="FindBySubjectName"
certificateFindValue="organization.pki.gov.md"
url="https://{{ host }}:{{ port }}">
<layout type="JsonLayout">
<attribute layout="${event-properties:item=event_time:whenEmpty=${date:format=yyyy-MM-ddTHH\:mm\:ss.fff}}" name="event_time"/>
<attribute layout="${event-type-prefix}.${event-properties:item=event_type}" name="event_type"/>
<attribute layout="${event-properties:item=event_id}" name="event_id"/>
<attribute layout="${event-properties:item=event_correlation}" name="event_correlation"/>
<attribute layout="${event-properties:item=event_level}" name="event_level"/>
<attribute layout="${event-properties:item=event_source}" name="event_source"/>
<attribute layout="${event-properties:item=event_message:whenEmpty=${message}}" name="event_message"/>
<attribute layout="${event-properties:item=event_details}" name="event_details"/>
<attribute layout="${event-properties:item=legal_entity}" name="legal_entity"/>
<attribute layout="${event-properties:item=legal_basis}" name="legal_basis"/>
<attribute encode="false" layout="${event-properties:item=legal_reason:jsonProperty=true}" name="legal_reason"/>
<attribute layout="${event-properties:item=user}" name="user"/>
<attribute layout="${event-properties:item=user_session}" name="user_session"/>
<attribute layout="${event-properties:item=user_address}" name="user_address"/>
<attribute encode="false" layout="${event-properties:item=subject:jsonProperty=true}" name="subject"/>
<attribute layout="${event-properties:item=subject_type}" name="subject_type"/>
<attribute layout="${event-properties:item=subject_name}" name="subject_name"/>
<attribute encode="false" layout="${event-properties:item=object:jsonProperty=true}" name="object"/>
<attribute encode="false" layout="${event-properties:item=object_type:jsonProperty=true}" name="object_type"/>
<attribute layout="${event-properties:item=object_name}" name="object_name"/>
</layout>
</target>
</targets>
<rules>
<logger minlevel="Info" name="mlog" writeTo="mlogTarget"/>
</rules>
</nlog>
Product | Versions 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.
-
- EGC.MLog.Client (>= 1.0.3)
- NLog (>= 4.4.12)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
First release