How to: Use the
Run the Enterprise Library Configuration tool and use file open to load the app.config file for the app you want to configure to use logging and tracing.
|
The default Logging and Instrumentation Application Block
Distributor Settings define two Categories (General,
and Trace). Categories are text tags that you
may apply to your log events to group them. The
General
category defines one destination, Event Log
Destination, which pairs the Event Log Sink
with the Text Formatter. The
Trace category defines on destination, Flat File
Destination, which pairs the Flat File Sink
with the Text Formatter.
|
New categories may be added by right clicking on Categories and
selecting New | Category. A category may have
many destinations. A destination defines a log formatter and
log sink pair. Each formatter and sink many be used in many
destinations.
|
Note two logging configuration files (loggingconfiguration.config and loggingdistributorconfiguration.config) have been created.
The logging configuration files must be copied to the target
compilation directory. Select the Project | Properties
…
menu command to view the Property Pages.
Select
Common Properties | Build Events and add the
following code to the Post-build Event Command Line.
|
|