Should RMB enable FolioLog4j2LogDelegate by default?

Description

RMB-211 adds a FolioLog4j2LogDelegate where log.error(e) is changed to also log the stacktrace of exception e. We usually want the stacktrace in the log.

Do we want RMB to automatically enable this for all modules that use RMB?

This is a one line change in RestLauncher.java - replace Log4j2LogDelegateFactory by FolioLog4j2LogDelegateFactory: https://github.com/folio-org/raml-module-builder/blob/master/domain-models-runtime/src/main/java/org/folio/rest/RestLauncher.java

Environment

None

Potential Workaround

None

Checklist

hide

TestRail: Results

Activity

Show:

Marc Johnson August 17, 2018 at 12:49 PM

Thanks.

Julian Ladisch August 17, 2018 at 12:47 PM

A module may create this to switch it on:

public class MyRestLauncher extends RestLauncher { static { // will be invoked after RestLauncher's static block System.setProperty(LoggerFactory.LOGGER_DELEGATE_FACTORY_CLASS_NAME, "io.vertx.core.logging.FolioLog4j2LogDelegateFactory"); } }

Marc Johnson August 17, 2018 at 12:37 PM
Edited

I think if we always want exceptions to be logged in this manner and we want this to happen without the intervention (or awareness) of the module developer (which I believe was the concern with the log writing class I had previously used), then I think it should be switched on by default.

If we didn't have it switched on by default, and modules needed to activate it, where in the lifecycle would that be done (as I imagine logging is initialised early in the RAML Module Builder initialisation process)?

Details

Assignee

Reporter

Priority

Development Team

Core: Platform

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created August 17, 2018 at 12:05 PM
Updated July 5, 2021 at 10:18 AM
TestRail: Cases
TestRail: Runs

Flag notifications