by Marius Gheorghe
18. May 2007 12:49
Note: Parts of this apply to v1.3.4 which will be released new week.
DataBlock supports 2 logging methods : - automatic logging of SQL queries (for debugging purposes). This can be enabled/disabled from the config file : <appSettings> <!--log settings--> <add key="LogEnabled" value ="False"/> <add key="LogFilePath" value ="sql.txt"/> </appSettings> or from the Configuration class. Where running from a ASP.NET application make sure the user has rights to write to the specified file. - runtime logging( this will be available in 1.3.4) which allows you to trace sql queries . Here is how to use this Configuration.OnQueryLogging += new QueryLoggingEventHandler(OnLog); protected void OnLog(string data) { //here you can log the query appending the execution context (user name, credentials etc). } Note that the event handler for the QueryLoggingEventHandler is called
BEFORE the query will be executed.