Mendix Logging Best Practices: When to Use Logs, When Not To, and How to Avoid Performance Issues - Mendix Forum

Mendix Logging Best Practices: When to Use Logs, When Not To, and How to Avoid Performance Issues

0

Logs are one of the most powerful tools for debugging and monitoring Mendix applications — but if not used wisely, they can quickly become a performance bottleneck. In this blog, let’s break down how to use logs effectively, when to use them, when not to, and their overall impact on your system.

 

What are Logs in Mendix?

In Mendix, logs are runtime messages that provide insight into what your app is doing at any moment. They can include:

 

You can view these logs in:

How to Use Logs

You can add custom logs using the Log Message activity in microflows or by using logMessage in Java actions.

Examples:

You can also set log levels like TRACE, DEBUG, INFO, WARNING, ERROR to control visibility.

 

When to Use Logs

Use logs when:

  1. Debugging issues during development or QA
  2. Monitoring critical business processes in production (e.g., API calls, failed payments)
  3. Tracing performance issues (e.g., how long a microflow takes)
  4. Catching unexpected errors with details for investigation
  5. Monitoring user actions in complex UI flows

When NOT to Use Logs

Avoid using logs:

  1. Inside tight loops or recursive logic (e.g., looping over 1000 records)
  2. For every small UI action (e.g., dropdown selection, mouse hover)
  3. In production at TRACE/DEBUG level — it clutters logs and slows performance
  4. To store business-critical data — logs are for developers, not for auditing
  5. Without conditions — logging large objects or associations blindly can hit memory

 

Impact on Performance

Here’s how excessive or careless logging can affect your Mendix app:

🔹 1. System Performance

 

🔹 2. Database

 

🔹 3. Memory Usage

 

🔹 4. User Interface

Best Practices

 

Posted
0 comments