<-- Back

How to enable custom log nodes

Introduction

To ensure consistent and reliable logging within Mendix applications, it is essential to proactively register custom log nodes during the application's startup. Since log nodes are dynamically created, failure to register them early—specifically in the After Startup microflow—can prevent them from appearing until an initial message is logged.

As informed in module 5 of the learning path Track Application Behavior with Logging, if you do not register your log node in the After Startup microflow, it will not become available until the first log message is written.

Environment

Studio Pro (all versions)

Instructions/Procedure

The steps below are to show how to create the custom logs and initiate them in the After Startup microflow:

  1. In the module, create a new microflow named something like InitializeLogNodes
  2. Inside the microflow, add a Log Message activity
  3. For each custom log node, log a simple info-level message (e.g., "Initializing log node: MyCustomNode")
  4. Repeat for all nodes to register.

Setting up the After Startup microflow:

  1. Navigate to the project settings within the Mendix Studio Pro
  2. Select the Runtime tab within the project settings
  3. Select the desired microflow from the list to be executed as the After Startup microflow.  

Outcome

The custom log nodes will appear immediately upon app startup.

To validate the custom log node availability:

  1. Run the app in Mendix Studio Pro
  2. Open the Console and go to Advanced > Log Levels
  3. The custom log nodes should now be visible and manageable.

Internal information related

255330

Additional information

Mendix Academy - 5.3.1 Initializing Your Log Nodes - Implementing Logging In Your Own App - Track Application Behavior with Logging

Set Log Levels | Mendix Documentation

Have more questions? Submit a request

0 Comments

Article is closed for comments.

To provide feedback, please open a ticket here. Don't forget to include the article's URL along with the feedback you would like to provide.