Logging Module

Category: Modules
Subcategory: Tracing

Overview

Update 13-12-2021 related to CVE-2021-44228: The Logging module does NOT use the vulnarable log4j 2 library. No update is needed for this module.

Module that stores all log messages of your application as Mendix objects in the database, enabling you to view and search the log in the Mendix web client. Can be used in addition to the normal logging options (logging to file or the Mendix console) and has its own independent log level setting.

Documentation

Description

Module that stores all log messages of your application as Mendix objects in the database, enabling you to view and search the log in the Mendix web client.

Can be used in addition to the normal logging options (logging to file or the Mendix console) and has its own independent log level setting.

Also contains a scheduled event for periodically cleaning up old log messages.

 

Typical usage scenario

  • To provide administrators of your application access to the log from within the Mendix web client.
  • If you want to be able to quickly search the log for any errors, without having to do a text search of the log file.

 

Features and limitations

  • Which log levels should be logged (for example INFO and higher) is configurable and independent from other logging options (like logging to a file).
  • Log messages can be deleted by an administrator.
  • Contains a scheduled event (CleanupDataLogging) that can periodically cleanup old log messages; how long messages should be kept before deleting them is configurable using a constant (LogHistoryDays).
  • Writing all log messages to the database can have a negative impact on the performance of your application, depending on the number of messages. In a production environment, it is recommended to log only messages of level WARNING and higher.

 

Installation

See the general instructions under How to Install.

 

Dependencies

  • Mendix 8.12.5 Environment
  • No further dependencies

 

Configuration

  • Set the after startup and before shutdown microflows in your project settings: these should point to the microflows AfterStartup (in the folder Start) and BeforeShutdown (in the folder Stop) of the Logging module.
  • Use the snippet Message_Overview_Content (in the User Interface folder of the Logging module) somewhere in your application.
  • Assign the module roles Admin and/or ReadOnly of the Logging module to some of your user roles. Both roles can view the log, but Admin can also delete the log messages.
  • Set the constant Logging.Level to the desired value: by default the value is INFO, for the other possible values see the documentation of this constant in the modeler.
  • (optional) Enable the scheduled event Logging.CleanupDataLogging and configure the constant Logging.LogHistoryDays: by default the value is -1, which disables the cleanup of old log messages; for the other possible values see the documentation of this constant in the modeler.

 

Known bugs

  • None

 

Frequently Asked Questions

Ask your question at the Mendix Community Forum

  • None

Releases

Version: 1.9.0
Framework Version: 8.12.5
Release Notes: Fix memory leak in java action
Version: 1.8.1
Framework Version: 8.12.5
Release Notes: Added licence in marketplace (no module change)
Version: 1.8.0
Framework Version: 8.12.5
Release Notes: Upgrade to Mendix 8.12.5
Version: 1.7.0
Framework Version: 7.23.0
Release Notes: Upgrade to Mendix 7.23.x for use in Mendix 8.
Version: 1.6.0
Framework Version: 7.9.0
Release Notes: Add function to delete a selection of messages. In addition to the function "Delete all messages". This can be used to delete simular "errors" after fixing the cause