Solutions
...
Litmus Production Record Datab...
Interacting with Litmus Produc...
Reading out the Log Tables for Litmus Production Record Database
7min
use cases to ensure the supportability and sustainability of litmus production record database reading out the log for the various subsystems to monitor for example 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 s elect query with function prorec misc getlogfiledatautc as from clause note as the log tables for the various sub systems can store a lot of entries in the verbose mode , t o 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 docid\ nizz5qavwknlczz51008q input variables variable name datatype description example @logfile varchar (25) this can be used to return entries of only one specific log table available are tag log log entries associated with the subsystem which stores handles storing of tag data prorec log log entries associated with the subsystem which handles storing of production record events event log log entries associated with the subsystem which handles the monitoring of tag data for production events and then record these events misc log log entries for miscellaneous tasks like backup creation, factory reset or purging of tables error log log entries from the dedicated error log table if no specific table is to be queried for, the value can be left as default which will return data from all tables tag log default @logtype varchar (25) this can be used to only return entries for a specific log type such as info , warning , error if no specific log type is to be queried for, the value can be left as default which will return all log types info default @logprocedure varchar (50) this can be used to only return entries created by a specific stored procedure which is part of a litmus production record database sub system if no specific log type is to be queried for, the value can be left as default which will return all log types prorec at tag processtransactions default @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 getlogfiledatautc providing all the required inputs below is an example using t sql in sql server management studio select from \[dbo] \[prorec misc getlogfiledatautc] ( default ,default ,default ,default ,default) result the function returns a table as result 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 getlogfiledatautc] ( default ,default ,default ,default ,default) order by logtime desc the result will be a table, where all rows are sorted by their logtime in descending order