Click here to Skip to main content
12,076,727 members (45,297 online)
Click here to Skip to main content

Stats

20.2K views
469 downloads
32 bookmarked
Posted

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.

You may also be interested in...

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