This page has moved or been replaced. The new page is located here:

Please update any bookmarks that point to the old page.

Download this Manual
User Comments
  Posted by Craig Fowler on December 13, 2013
This is already filed as a bug: - but for the benefit of anybody reading now, the example/steps given above for configuring tracing at runtime is misleading.

In order to configure tracing at runtime, do NOT create a new TraceSource object as the documentation suggests (what the documentation is referring to is a process that the connector is doing in its own internals). Instead use the object:


This object provides static properties for configuring the Switch and the Listeners collection. Here is a working example that does not use any application configuration:

using MySql.Data.MySqlClient;
using System.Diagnostics;

var switch = new SourceSwitch("My switch", "Verbose");
var listener = new ConsoleTraceListener() { Name = "Console" };

MySqlTrace.Switch = switch;

// Provided that 'Logging=True' is present in your connection string, the connector will now output verbose trace messages to the console.

Note that the example given in the documentation which uses the application configuration file to configure tracing works just fine as-is.
Sign Up Login You must be logged in to post a comment.