NLog.IndentException
0.1.9
dotnet add package NLog.IndentException --version 0.1.9
NuGet\Install-Package NLog.IndentException -Version 0.1.9
<PackageReference Include="NLog.IndentException" Version="0.1.9" />
paket add NLog.IndentException --version 0.1.9
#r "nuget: NLog.IndentException, 0.1.9"
// Install NLog.IndentException as a Cake Addin
#addin nuget:?package=NLog.IndentException&version=0.1.9
// Install NLog.IndentException as a Cake Tool
#tool nuget:?package=NLog.IndentException&version=0.1.9
console log sample
Here is console output for layout like layout="${level} ${message}${onexception:${newline}${IndentException:LogStack=false:separator=	:beforeType=:aftertype=}}"
there is no stack trace shown (because of LogStack=false
)
Error tryException failure
ArgumentException outer exception
KeyNotFoundException innerException
Error failed to start NLogTest
ArgumentException bad try
ArgumentException outer exception
KeyNotFoundException innerException
file log sample
Below you can find file logging sample using layout layout="[${threadid}] ${longdate} ${level} (${logger}) ${message}${onexception:${newline}${IndentException}}
outer exception
and inner exception
stack trace is logged only once. Error type and message are logged only if error processing code tries to log the same exception second time
[1] 2019-01-27 19:56:57.7258 Debug (YourNamespace.NLog.Extention.Test.Program) starting
[1] 2019-01-27 19:56:57.7769 Error (YourNamespace.NLog.Extention.Test.Classes.UnitOfWork) tryException failure
[ArgumentException] outer exception
at YourNamespace.NLog.Extention.Test.Classes.UnitOfWork.outerException()
at YourNamespace.NLog.Extention.Test.Classes.UnitOfWork.tryException()
[KeyNotFoundException] innerException
at YourNamespace.NLog.Extention.Test.Classes.UnitOfWork.innerException()
at YourNamespace.NLog.Extention.Test.Classes.UnitOfWork.outerException()
[1] 2019-01-27 19:56:57.7769 Error (YourNamespace.NLog.Extention.Test.Program) failed to start NLogTest
[ArgumentException] bad try
at YourNamespace.NLog.Extention.Test.Classes.UnitOfWork.tryException()
at YourNamespace.NLog.Extention.Test.Program.Main(String[] args)
[ArgumentException] outer exception
[KeyNotFoundException] innerException
[1] 2019-01-27 19:56:57.8344 Debug (YourNamespace.NLog.Extention.Test.Program) the end
Learn more about Target Frameworks and .NET Standard.
-
- NLog (>= 4.5.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
.Net standard project format is supported