Library Logging

Content Type: Module
Categories: Tracing

Overview

Libraries used by modules can generate crucial information for troubleshooting (or even their normal functioning). This module can redirect logs from certain libraries (based on classpath) to Mendix lognodes.

It leverages the Log4j framework and includes a slf4j to log4j adapter.

Documentation

Demo urlhttps://github.com/ArjenLammers/library-logging

Description

Libraries used by modules can generate crucial information for troubleshooting (or even their normal functioning). This module can redirect logs from certain libraries (based on classpath) to Mendix lognodes.

It leverages the Log4j framework and includes a slf4j to log4j adapter.

Typical usage scenario

  • Developing or troubleshooting a module or connector which uses a library which logs information through one of the mentioned frameworks.
  • Capture inner working of a library in your application's log to ensure its working.

Features and limitations

Redirect logging messages from one of the following frameworks to a Mendix lognode:

  • Log4j
  • Slf4j
  • apache-common

Dependencies

This module will typically be a dependency of other modules.

Installation

Fresh installation

Download the module from the App Store

Upgrade notice

Before downloading a new version of the module from the App Store, remove all the jar files having a corresponding LibraryLogging.RequiredLib in their filename. These are typically files starting with:

  • log4-api
  • log4j-core
  • log4j-jcl
  • log4j-slf4j
  • slf4j-api

Configuration

Attach the AfterStartup microflow from the _USE_ME folder to your startup flow.

For module developers

Use the action AddLibraryLogListener redirect all log messages from a certain classpath to a Mendix log node. Use the action SetRootLevel to log everything to a Mendix lognode (recommended for developing purposes only)

Known bugs

Let me know and I'll add them to the list.

Releases

Version: 1.8.0
Framework Version: 9.18.0
Release Notes: Prepare for Mendix 10 release.
Version: 1.7.0
Framework Version: 8.12.0
Release Notes: Upgraded Log4j library. Included new bridge from SLF4j to Log4j for compatibility with SLF4j 2.x. Included README.md Thanks to Emiel Paasschens
Version: 1.6.0
Framework Version: 8.12.0
Release Notes: Upgraded to log4j 2.17.1 due to CVE-2021-44832. IMPORTANT: Remove all libraries of the previous version from your userlib, which are: log4j-api-.jar log4j-core-.jar log4j-jcl-.jar log4j-slf4j-impl-.jar
Version: 1.5.0
Framework Version: 8.12.0
Release Notes: Upgraded log4j due to CVE-2021-45105. IMPORTANT: Remove all libraries of the previous version from your userlib, which are: log4j-api-.jar log4j-core-.jar log4j-jcl-.jar log4j-slf4j-impl-.jar
Version: 1.1.4
Framework Version: 7.23.0
Release Notes: Upgraded to log4j 2.17.1 due to CVE-2021-44832. IMPORTANT: Remove all libraries of the previous version from your userlib, which are: log4j-api-.jar log4j-core-.jar log4j-jcl-.jar log4j-slf4j-impl-.jar