Some of the targets supported by NLog require installation to be performed on the machine before the target can be used. For example, when logging to a database, a DBA needs to create the necessary tables, when logging to event log or performance counter, administrator of the machine must create them before the application can write to them.
NLog 2.0 comes with a new tool and APIs that lets you manage installation and uninstallation of objects which support logging.
Say you want to write logs to:
With NLog 2.0, you can embed installation/uninstallations steps directly in the log configuration file, like in the following example:
<?xmlversion="1.0"encoding="utf-8" ?><nlogxmlns="http://www.nlog-project.org/schemas/NLog.xsd"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><targets><targetxsi:type="Database"name="db"><!-- SQL command to be executed for each entry --><…