(note I got Antigravity/Gemini Flash 3.8 to help me write this up)
Context
Lucee 6/7’s native Maven dependency integration in Application.cfc (javaSettings.maven) and mavenLoad() is a fantastic capability that makes bringing modern Java libraries into CFML seamless.
In modern Java development, virtually every major library (AWS SDK v2, WebAuthn, Stripe, Nimbus OIDC, Apache HttpClient 5) logs through the SLF4J 2.x facade.
The Problem Today
When an application loads any Java dependency using SLF4J:
- Startup Warning: Because Lucee’s dynamic Maven classloader does not provide an SLF4J provider, SLF4J emits this warning to
stderron first use:SLF4J(W): No SLF4J providers were found. SLF4J(W): Defaulting to no-operation (NOP) logger implementation SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details. - Lost Diagnostics: Once SLF4J defaults to NOP, all subsequent log messages (including warnings and critical errors) from that library are permanently discarded. They never surface in Lucee’s
application.log, console, or<cflog>. - Manual Workaround: To suppress the warning or control logging today, developers have to manually hunt down and add an SLF4J provider (e.g.
"org.slf4j:slf4j-nop:2.0.17") to theirjavaSettings.maven.
Existing Precedents in Lucee
Lucee has already encountered and solved this exact classloader/facade problem for older logging frameworks:
- Apache
commons-logging(LDEV-5688): Lucee implementedLuceeLoaderLogFactoryin the loader to interceptcommons-loggingcalls from Maven JARs and route them into Lucee’s logging subsystem. - Hibernate / JBoss Logging (LDEV-6159): Lucee created
LuceeJBossLoggerProviderso Hibernate logs pipe directly into Lucee’s nativeorm.log. - Quartz Extension (LDEV-6662): Gian noted in the plan: “Quartz’s SLF4J output should not go to an unconfigured log4j; route it through Lucee logging, or at least to a silent no-op binding”.
SLF4J 2.x is currently the missing bridge in the trio.
Proposed Solution
Since Lucee core already runs natively on Log4j 2 (Log4j2Engine):
- Provide an SLF4J 2.x Provider:
Apache already maintains the official bridge:org.apache.logging.log4j:log4j-slf4j2-impl. If Lucee provides this bridge (or a lightweight customSLF4JServiceProvider) on the parent classloader forjavaSettings:- All
logger.info(),warn(), anderror()calls from Maven libraries automatically flow into Lucee’s Log4j 2 system (e.g. intoapplication.logor a dedicatedjava.log). - Clean, zero-warning boot on modern JVMs.
- All
- Application Control:
Could Lucee allow configuring third-party Java log levels or targets viaApplication.cfc(similar to howormSettingsconfigures Hibernate logging)?
Curious to hear the core team’s thoughts on bridging SLF4J 2.x into Lucee core as the natural next step for javaSettings.maven.