How To Setup the Built-in Configuration
Overview
You may have tried the built-in configuration of other logging frameworks, but don't fret. You won't have to break out the Excedrin for Termite. Configuring your loggers couldn't be easier.
A couple things to note. It isn't necesary to use the built-in configuration.
You can continue to configure your loggers in any way you please. Also, the functionality of the built-in configuration does not encompass the entire framework.
There are more loggers and features available in the framework that can still be used and configured programatically. But using the built-in configuration will probably satisfy 90% of your needs.
Step by Step
Make your life easier. Follow these first steps to enable the logging configuration intellisense in Visual Studio.
- Copy the included BitFactory.Logging.xsd file into the folder
<%VisualStudioInstallFolder%>\xml\schemas
- Inside that same folder is a file called catalog.xml. Edit this file,
placing the following line inside the <SchemaCatalog> node:
<Schema href="%InstallRoot%/xml/schemas/BitFactory.Logging.xsd"
targetNamespace="http://BitFactory.Logging"/>
Save the file.
- Inside your application's config file, you need to have a configSections node.
You should setup your config file as follows. Keep the name and type exactly as shown.
<configuration>
...
<configSections>
<section name="BitFactory.Logging"
type="BitFactory.Logging.Configuration.LoggingSection, BitFactory.Logging"/>
</configSections>
- Now create the logging section. Somewhere within the configuration node, perhaps
just below the configSections section, copy the following:
<BitFactory.Logging name="global" xmlns="http://BitFactory.Logging">
</BitFactory.Logging>
That's it!
You're now setup and ready to use the built-in configuration. All the magic happens inside the node you created in step 2
of the project setup. Go here for more specifics about configuring the loggers.