VistaDB 5
Gibraltar VistaDB > Developer's Guide > Developer's Guide - Logging
Developer's Guide - Logging

The VistaDB engine supports a diagnostic interface for recording health and performance information while it runs.  By implementing this interface your application can easily log these events for your review later.

What Kind of Information is Available?

Depending on the log level that is active a range of information is available including:

  • TSQL Statements:  Each SQL Batch and its input parameters are provided so you can see the underlying SQL generated by your application. 
  • TSQL Statement Results: When the end of a result set is reached (even for situations where there are multiple result sets generated in a single TSQL Batch) an event is reported.
  • Data Returned: In Debug mode the actual row data returned is reported.
  • TSQL Errors: Any exception thrown out of the engine, including SQL-related errors, are reported.
  • Pack and Repair Operations: As these operations are called and run their status is reported.  If a problem is encountered then more detailed information is provided which can assist in determining the scope of the problem.

Over time more information may be added to the logging data as it's found to be useful.

Even if a database is encrypted the input queries and data returned can be logged unencrypted.  This is because logging happens near the client well above the encryption/decryption layer.  Since logging has to be set up at compile time in the process you can elect whether you want to enable logging in your encrypted application.

How Do I Enable Logging?

To record information you will need to either create your own implementation of the ILog Interface and register it with the Logging Class or use the Loupe Agent for VistaDB which implements this interface and routes the information into the Loupe Agent. 

  • To register an instance of a logging class to receive messages call the Add Method.
  • To remove a previously registered logging class call the Remove Method.

Multiple classes can be registered to receive messages.  All will be called when a new message is available.

Does it Impact the Performance of VistaDB?

It depends on the log level that is chosen.  The Normal level is designed to have no measurable performance impact and the Detailed level has minimal performance impact.  Both are suitable for continuous use in a deployed application.  The Debug level can have notable performance impact depending on the speed of the log system and the specific operations performed.

To prevent an error in a logging class from affecting the engine, any exception thrown by a logger will be caught by the engine and will not be logged (since logging it may cause an infinite loop). 

See Also