Solutions
...
Litmus Production Record Datab...
Interacting with Litmus Produc...

Reading out the Log Table for the asynchronous scheduler

7min

Use Cases

To ensure the supportability and sustainability of Litmus Production Record Database reading out the log for the asynchronous scheduler 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.

Method

Run SELECT query with Function PROREC_Misc_GetSchedulingErrorsUTC as FROM clause.

Note

As the log tables for the various sub systems can store a lot of entries in the verbose mode, to not overwhelm the storage requirements for Litmus Production Record Database, the table holds by default only one day of records. This can be modified through the stored procedure introduced by the chapter Modify Application Configuration Items

Input Variables

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

How to use

To read out the log data, execute a SELECT statement from the function PROREC_Misc_GetSchedulingErrorsUTC providing all the required inputs. Below is an example using T-SQL in SQL Server Management Studio:

SELECT * FROM [dbo].[PROREC_Misc_GetSchedulingErrorsUTC] ( DEFAULT ,DEFAULT)

Result

The function returns a table as result.

Document image


Additional Options

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:

SELECT * FROM [dbo].[PROREC_Misc_GetSchedulingErrorsUTC] ( DEFAULT ,DEFAULT) ORDER BY LogTime desc

The result will be a table, where all rows are sorted by their LogTime in descending order.

Document image