Reading out the Log Table for the asynchronous background query execution
To ensure the supportability and sustainability of Litmus Production Record Database reading out the log for the asynchronous background query execution to monitor for examples for errors is one of the cornerstones of a support strategy.
User can do this either by using applications such as:
- Microsoft SQL Server Management Studio
- MSSQL CLI
This can also be used for building custom solutions based on applications which allow for an ODBC connection such as:
- Excel
- C#
- .Net
- Python
Litmus does provide a function for this which can be used in either a SELECT statement as well can be part of a custom stored procedure.
Run SELECT query with Function PROREC_Misc_GetATServiceBrokerLogsUTC as FROM clause.
As the log table for the asynchronous background query execution stores the processed data as xml string, to not overwhelm the storage requirements for Litmus Production Record Database, the table holds by default only one hour of records. this can be modified through the stored procedure introduced by the chapter Modify Application Configuration Items
Variable name | Datatype | Description | Example |
---|---|---|---|
@StartTime | DATETIME | The start of the time period for which to query data. If no specific start time is required, the value can also be DEFAULT which will assume the value null. This will trigger the function to calculate a start time of -1h from the current time stamp. This means the default time period for which data are returned is always the last hour. | 2023-03-09T13:04:39.647 DEFAULT |
@EndTime | DATETIME | The end of the time period for which to query data. If no specific end time is required, the value can also be DEFAULT which will assume the value null. This will trigger the function to use the current time stamp. This means the default time period for which data are returned is always the last hour. | 2023-03-10T13:04:39.647 DEFAULT |
To read out the log data, execute a SELECT statement from the function PROREC_Misc_GetATServiceBrokerLogsUTC providing all the required inputs. Below is an example using T-SQL in SQL Server Management Studio:
The function returns a table as result.
It is possible to sort data based on users requirements returned by the SELECT statement. Below is an example using T-SQL in SQL Server Management Studio:
The result will be a table, where all rows are sorted by their LogTime in descending order.