Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

NLog Log and Audit Advanced Target

, 26 May 2010 CPOL
A way to audit your business objects using NLog.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  
  <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <extensions>
      <add assembly="App.Logger"/>
    </extensions>

    <targets>
      <target name="OHTarget" type="OHTarget"
              connectionString="Server=.;Database=ObjectLog;UID=sa;PWD=P@ssw0rd;"
              DBTablesPrefix=""
              DbProviderInvariantName="System.Data.SqlClient"
              AutoCreateDatabase="True"
              LogTypes="name:App.Logger.WebTests.BusinessObjects.Supplier;key:SupplierID;properties:CompanyName,InvoicingAddress,Balance;" />
    </targets>
    <rules>
      <logger name="*" minlevel="Trace" writeTo="OHTarget" />
    </rules>
    
  </nlog>  
  
</configuration>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

AlexCode
Architect
Switzerland Switzerland
Senior IT Consultant working in Switzerland as Senior Software Engineer.
 
Find more at on my blog.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.141223.1 | Last Updated 26 May 2010
Article Copyright 2010 by AlexCode
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid