ELMAH target for NLog
Extensions to NLog
Install the library with Nuget
Install-Package NLog.Elmah
Update NLog to the latest version
Update-Package NLog
Read the NLog tutorial
Example 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"
internalLogFile="c:\temp\nlog-interal.txt" internalLogLevel="Info"
>
<targets>
<target name="target1" xsi:type="Elmah" LogLevelAsType"false" />
</targets>
<rules>
<logger name="*" minlevel="Info" writeTo="target1" />
</rules>
</nlog>
config:
LogLevelAsType
: Use Level as type if logged Exception isnull
.
Check the internal log (c:\temp\nlog-interal.txt) in case of problems
Also, users can safely ignore the warning it throws for that custom target:
This is an invalid xsi:type 'http://www.nlog-project.org/schemas/NLog.xsd:Elmah'
Not strong named (SNK) because the dependency isn't strong named.