Skip to main content
Inspiring
March 25, 2025
Answered

Is there any problem when disabling log4j2 jmx?

  • March 25, 2025
  • 1 reply
  • 451 views

My web server is using CF2021 update18 (Log4j version 2.20.0: jmx enabled default: -Dlog4j2.disable.jmx=false).
-When I set metaspace = 256, the memory has nearly 2 million elements of org.apache.logging.log4j.core.jmx.LoggerContextAdmin (watched by jmap -dump).
-When metaspace = 512, the memory drops to about more than 500 thousand elements.
-When disabling jmx (-Dlog4j2.disable.jmx=true, Log4j Starting in version 2.24.0 JMX support is disabled by default), the memory no longer has .jmx.LoggerContextAdmin (as expected to reduce memory).

 

So my question is: When disabling jmx, will it affect coldfusion? (my web server)

※I hope it doesn't affect anything my web server

Best regards.

    Correct answer Charlie Arehart

    I'm not aware of cf leveraging any aspect of jmx, which as you may know makes various metrics available for consumption. That seems especially so for jmx about log4j. But maybe someone else will have more specific clarity on that. 

     

    I'll say I'm surprised by your findings, and those workarounds: I've not heard of either being mentioned previously. Indeed, I'm inclined to wonder if there's more to your observed memory rise with the bulk being the log4j objects. Perhaps you have some other feature enabled that does excessive logging (like the jdbc logging option for cf's included datasource types), or perhaps code doing cflog/writelog that is run at huge rates. There are ways one could detect that by the results created, if not found more readily otherwise. 

     

    Anyeay, thanks for sharing the info you have in case it may help others who'd find this.

    1 reply

    Charlie Arehart
    Community Expert
    Charlie ArehartCommunity ExpertCorrect answer
    Community Expert
    March 25, 2025

    I'm not aware of cf leveraging any aspect of jmx, which as you may know makes various metrics available for consumption. That seems especially so for jmx about log4j. But maybe someone else will have more specific clarity on that. 

     

    I'll say I'm surprised by your findings, and those workarounds: I've not heard of either being mentioned previously. Indeed, I'm inclined to wonder if there's more to your observed memory rise with the bulk being the log4j objects. Perhaps you have some other feature enabled that does excessive logging (like the jdbc logging option for cf's included datasource types), or perhaps code doing cflog/writelog that is run at huge rates. There are ways one could detect that by the results created, if not found more readily otherwise. 

     

    Anyeay, thanks for sharing the info you have in case it may help others who'd find this.

    /Charlie (troubleshooter, carehart. org)
    Inspiring
    March 26, 2025

    Dear Charlie,

    Thank you very much for your response.

    As you said, maybe my web service is logging excessively.

    You're welcome!