Lucee includes slf4j.nop-1.7.12.jar


Lucee includes lucee-server/bundles/slf4j.nop-1.7.12.jar in as part of it's core bundles. This causes issues when trying enable logging for any third party Java libraries that use SLF4j for logging.

SFL4j only allows a single binder to be added to the class loader path. Since the javaSettings uses a parent-first class loading strategy (which is the generally the default for classing loading from my understanding), you can't just drop in another binder into your third party lib folder to overwrite the logging rules.

For example, I can't drop in slf4j-log4j12-1.7.12.jar to use the Log4j configuration for logging or use the Logback jars instead.

I'm not sure why the slf4j.nop-1.7.12.jar is included in Lucee, because according to the SLF4j Manual (see Binding with a logging framework at deployment time) should log to /dev/null when there are no binders, just like the slf4j.nop-1.7.12.jar binder does.

It would seem like the better option would be to simply remove slf4j.nop-1.7.12.jar from deployment so users can add in their own adapters (like you can with ACF).

Optionally, either the Log4j or Logback binders could be implement which by default send everything to a NOP logger. That would at least give you the ability to programmatically change the logging at runtime for a class. With the NOP binder being used, it does not appear there is any way to change the binder at runtime.


Dan Switzer, II
September 17, 2020, 3:10 PM

I've started a thread here describes my problem in more detail:

Dan Switzer, II
September 18, 2020, 11:53 AM

Is there a technical reason Lucee includes the NOP binder?

If I tried adding a Lucee extension which shipped a 0-byte {{slf4j.nop-1.7.12.jar}} file and added the Log4j or Logback binders, would that cause any issues?

Dan Switzer, II
October 15, 2020, 12:11 PM

The only solution I was able to come up with was to use the JavaLoader.cfc component instead of using the Application.cfc's javaSettings feature.




Dan Switzer, II


Affects versions