1

When configuring a database connection to NLog, i found that it was not producing anything to the database even though i was 100% sure i had it right. I discovered the culprit was my Stackify target. When i remove the stacify target the database connection write works perfectly.

I would like to retain Stackify in my solution though. Anyone know why this is conflicting, and if i can revise the stackify target to not block/destroy my database target?

 <target name="database" 
                xsi:type="Database"
                connectionStringName="NLog"
                commandText="exec dbo.InsertLog
                                @level,
                                @callSite,
                                @type,
                                @message,
                                @stackTrace,
                                @innerException,
                                @additionalInfo">
                <parameter name="@level" layout="${level}" />
                <parameter name="@callSite" layout="${callsite}" />
                <parameter name="@type" layout="${exception:format=type}" />
                <parameter name="@message" layout="${exception:format=message}" />
                <parameter name="@stackTrace" layout="${exception:format=stackTrace}" />
                <parameter name="@innerException" 
                            layout="${exception:format=:innerFormat=ShortType,Message,Method:MaxInnerExceptionLevel=1:InnerExceptionSeparator=}" />
                <parameter name="@additionalInfo" layout="${message}" />
        </target>
        <target name="stackify" xsi:type="StackifyTarget" layout="${logger} / ${message}" />

does NOT work, but when i remove this line database target works just fine:

<target name="stackify" xsi:type="StackifyTarget" layout="${logger} / ${message}" />

why is that? Thanks in advance for the help!

p64imp
  • 11
  • 2
  • 1
    Which package do you use for the stackify target? What the version and what's nlog's version? What's is the platform? (.net core? Asp.net core? .net 4.5?). And please enable and check the internal log, that one will probably tell you the issue: https://github.com/nlog/nlog/wiki/Internal-logging – Julian Aug 08 '20 at 07:05

0 Answers0