Quantcast
Channel: Log in a file only if the database fails? - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by Julian for Log in a file only if the database fails?

$
0
0

Yes, you could use the FallbackGroup target for that. In the fallback group you should configure the database and file target.

e.g.

<target xsi:type="FallbackGroup" name="all" returnToFirstOnSuccess="true"><target name="target1" xsi:type="Database" ... /><target name="target2" xsi:type="File"     ... /></target><rules><logger name="*" minlevel="Trace" writeTo="all" /></rules>

See https://github.com/NLog/NLog/wiki/FallbackGroup-target


Viewing all articles
Browse latest Browse all 2

Trending Articles