Log Message

Last update: Edit

1 Introduction

With the Log message activity you can create messages that appear in the log of your Mendix application:

Log Message

2 Properties

There are two sets of properties for this activity, those in the dialog box on the left, and those in the properties pane on the right:

Log Message Properties

The Log message properties pane consists of the following sections:

3 Action Section

The Action section of the properties pane shows the action associated with this activity.

You can open a dialog box to configure this action by clicking the ellipsis () next to the action.

You can also open the dialog box by double-clicking the activity in the microflow or right-clicking the activity and selecting Properties.

3.3 Log Level

The log level defines the severity of the log message. In the Studio Pro Console pane, messages have a different color and an icon for some log levels.

Option Icon Description
Trace Used for detailed execution traces.
Debug Used to debug execution.
Info (default) Used to log informative messages.
Warning
Warning
Used to log warnings. These messages appear in orange.
Error
Error
Used to log error messages. These messages appear in red.
Critical
Critical Error
Used to log critical errors. These messages appear in white on red.

3.2 Log Node Name

The log node name is a microflow expression that defines the source of the log message. For example, if you log messages from an email module, the log node name could be Email module. Use your own log node names as this avoids confusion with messages from the Mendix runtime which are written to the Mendix log nodes. The Mendix log nodes are listed in the Default Mendix Log Nodes section of Logging.

3.3 Template

A Template defines the message text. The template can contain parameters that are written as a number between braces, e.g. {1}. The first parameter has number 1, the second 2, and so on.

3.4 Parameters

For each parameter in the template you define a microflow expression of which the value will be inserted at the position of the parameter. Parameters need to be entered using expressions resulting in a string.

3.5 Include Latest Stack Trace

Defines whether to include the stack trace of the latest error in this log message. In Studio Pro, log messages that include a stack trace are marked with a paperclip icon.

Double-clicking these log messages shows the stack trace.

This option also applies to $latestSoapFault. If you define an error handler for a web service call, and it catches a soap fault error, checking this box will add the stacktrace to the logline in Studio Pro.

4 Common Section

For more information on properties in this section, see Common Properties.