Colway Solutions
Modbus Member Logo

How To: Use Event Logger

What is the Event Logger?

The Event Logger feature writes important activities and events occurring in the application to a log file. For e.g. the MPT successfully connecting to a device is an event and this information is logged into the file. Event logging can be enabled or disabled. The level of log messages can also be controlled. All event logs are time stamped allowing a user to analyse the sequence of events occurring against a timeline.

What kind of activities and events get logged?

There are four kinds of events/activities that get logged: Errors, Warnings, Informational Messages, Verbose Messages. The logger can be configured to log at one of these levels.

  • Errors are events when MPT is unsuccessful in completing an activity or encounters and unexpected situation. An example is MPT being unable to establish a connection to the device.
  • Warnings are non-critical errors that occur in the application. An example is the user attempting to start a device simulator when one is already running.
  • Informational Messages provide logs of routine activities in the MPT and can be reviewed to check and ensure that all is well in the application. An example is the MPT successfully connecting to a device.
  • Verbose Messages provide detailed logs of activities in the application with an intention of providing sufficient information of the sequence of events occurring in the MPT for the purpose of debugging errors and failures in the application. For e.g. a verbose log is made when the user saves a Modbus Data Group form.
  • How to enable Event Logging and set the Logging Level

    1. Open the Options dialog box by choosing menu Tools->Set Options
    2. Check the Enable Logging checkbox
    3. Enter a file name for the log file including the full directory path. Alternatively click the browse button beside the file name text box to browse to a folder. Note that the MPT will not overwrite but will append log messages to this file.
    4. Select the logging level from the Level drop down list box. Please note that setting the log level to:
        Error logs only Error messages.
        Warning logs Error and Warning messages.
        Information logs Error, Warning and Informational messages.
        Verbose logs all types of events including Verbose messages.

    How to view the Event Log

    The Event log file is a text file and so can be viewed with any text editor. You can choose the menu Tools->View Event Log to open the Event log file in notepad.

    Description of an Event Log entry

    An entry in the Event log file has the following format:

    MPT <Log Level>: <Event ID>: <Date: DD-MM-YYYY> <Time: hh:mm:ss.ms> <Log message text>

    Where:

  • Log Level: Can be Error, Warning, Information or Verbose.
  • Event ID: Is a numeric identifier for the event. This field is currently unused and reserved for future use.
  • Date: The date when the log was made in DD-MM-YYYY format (e.g. 12-01-2010).
  • Time: Time with millisecond resolution at which the log was made in HH:mm:ss.ms format (e.g. 09:45:30.768). Hour is printed in 24 hour format.
  • Log message text: A text message describing the log.
  • A typical entry in the log file looks as below:

    MPT Information: 0 : 27-03-2010 12:21:11.633 Global settings changed

    See Also

    Topic link Launching your first Modbus Protocol Tester project
    Privacy Policy Site Map FAQ Contact Us