How to specify a custom eventlog in app.config
I'm trying to learn about .NET configuration files. I've setup my app.config file to log to the EventLog (apparently to the application log).
I'd like to know how I can tell the configuration file to create my own custom event log instead of using the application log.
Here is my configuration file.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="DBConnectionString" connectionString="TESTSTRING"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<!-- Uncomment the below section to write to the Application Event Log -->
<add name="EventLog"/>
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information" />
</switches>
<sharedListeners>
<!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="OCRTest"/>
</sharedListeners>
</system.diagnostics>
</configuration>
Thanks in advance to all replies.

