tabs ↹ over ␣ ␣ ␣ spaces

by Jiří {x2} Činčura

Improved command logging in ADO.NET provider for Firebird - part 2

19 Dec 2011 .NET, Firebird, Logging & Tracing

Previous version of ADO.NET provider for Firebird brought us a support for command tracing. Although it was good, it could be done better. Few interesting scenarios came back to as a valuable feedback and with the old implementation it was hard to do it.

The new one builds on top of TraceSource class allowing you to handle different sources from trace messages easily and independently. The what’s logged is same, but now every message is traced through FirebirdSql.Data.FirebirdClient source, hence you can easily i.e. turn it of (and just these messages, without affecting other messages) or send it to i.e. console window. Just a few lines in app.config and you’re done.

		<source name="FirebirdSql.Data.FirebirdClient">
				<clear />
				<add name="console" type="System.Diagnostics.ConsoleTraceListener"/>

The code above sends all messages (commands) from provider to (only) console window. You can use your own listener, of course or turn it off completely, using just the <clear />.