How to specify a custom eventlog in app.config RRS feed

  • Question

  • Hello all,

    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" ?>
        <add name="DBConnectionString" connectionString="TESTSTRING"
          providerName="System.Data.SqlClient" />
          <!-- This section defines the logging configuration for My.Application.Log -->
          <source name="DefaultSource" switchName="DefaultSwitch">
              <!-- Uncomment the below section to write to the Application Event Log -->
              <add name="EventLog"/>
          <add name="DefaultSwitch" value="Information" />
          <!-- 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"/>

    Thanks in advance to all replies.
    Friday, July 28, 2006 10:18 PM

All replies

  • Doing more research I've found a reference on goog that references My.Application.Log.EventLogName... however, I can't find it in the ms document or in inteliensese.
    Any ideas?
    Thanks in advance to all replies
    Tuesday, August 1, 2006 6:04 AM
  • What version of Visual Studio are you using?
    Tuesday, August 1, 2006 6:17 AM
  • I'm using Visual Studio 2005.
    Thanks for the reply.
    Wednesday, August 2, 2006 2:42 AM