Implementation of logging

In this chapter, some typical problems of logging under VisiWin are listed in brief. The central question is: "Where can I find what?". This is an overview of the project planning steps.

Task Project planning
Record variable value changes The process variable definitions contain the parameter Record value changes in the log server. If this parameter is activated, a corresponding entry is written to the log files when the value of the variable changes.
Set the location of the log file(s) The configuration of the logging system ( Logging > Configuration node in the project explorer) contains settings for the administration of the log files. The directory and name under which the log files are created are defined here.
Define and trigger further log events The definition of your own log events usually relates to processes from the visualisation application. When was which interaction carried out by the user? What comments or additional information were stored?

The definition of these events is realised in the protocol editor by creating new categories, protocol events and parameters. Triggering, on the other hand, must be implemented in the application via control element functions or source code.

  • Control element functions: In the Events property, a control element event can be linked to the system function Logging > Log.
  • Source code: The static function LogManager.Log in the VisiWin.Loggingnamespace triggers the specified log event.
View of the recorded data The HistoricalLoggingList control element lists the recorded events from the log files. Both the control element and the class contain a filter.

Programmatic access to the log file data is possible via the GetHistoricalData method of the HistoricalLogging class.