Logging Module

Content Type: Module
Categories: Tracing

Overview

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 9.24.0 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: 2.0.1
Framework Version: 10.6.0
Release Notes: New Features: - Dynamic Prefilter: Implemented a dynamic prefilter to allow filtering out messages before they are saved to the database. Changes: - Scheduled Event Behavior: Updated the CleanupDataLogging scheduled event behavior. It now skips the next event in case of a schedule overlap, rather than delaying it. - Mx10 support: The module is now working for Mendix 10.
Version: 2.0.0
Framework Version: 9.24.0
Release Notes: New Features: - Dynamic Prefilter: Implemented a dynamic prefilter to allow filtering out messages before they are saved to the database. Changes: - Scheduled Event Behavior: Updated the CleanupDataLogging scheduled event behavior. It now skips the next event in case of a schedule overlap, rather than delaying it.
Version: 1.10.0
Framework Version: 9.24.0
Release Notes: Update to Mx 9.24.0 Add filter to cleanup unwanted log messages
Version: 1.9.1
Framework Version: 8.18.0
Release Notes: - Upgrade to Studio Pro 8.18.0 - Small change to cleanup microflow
Version: 1.9.0
Framework Version: 8.12.5
Release Notes: Fix memory leak in java action