I have an application using Log4Net posting to SQL Server database. Since it is a multi-tenant application I would like it to record the TenantId. I have added the column in the Log table and added in the log4net.config the @tenantId to the Insert command and added the entry <parameter> <parameterName value="@tenantId" /> <dbType value="Int32" /> <layout type="log4net.Layout.RawPropertyLayout" > <key value="tenantId"></key> </layout> </parameter>
How do I make the change to pass the tenantId through to the Logger?
Thanks... Terry
1 Answer(s)
-
0
Hi,
I've no experience on that. This is log4net specific stuff. As I search on the web, there are some answers:
<a class="postlink" href="http://stackoverflow.com/questions/12139486/log4net-how-to-add-a-custom-field-to-my-logging">http://stackoverflow.com/questions/1213 ... my-logging</a> You can get value from AbpSession.TenantId as always.