Loading

Use Apache log4j JUL Adapter to Integrate java.util.logging.Logger With log4j2.xml Logging Level Settings in On-Premises Mule 4 App

Veröffentlichungsdatum: Jul 21, 2025
Aufgabe

GOAL

Adjust Logging Level for the Java Modules Using java.util.logging.Logger via Log4j2.xml in On-Premises Mule 4
Schritte
  1. Identify the log4j core module version by checking the version suffix in the file name of log4j-core-2.xx.x.jar in {MULE_HOME}/lib/boot . For an embedded Mule Runtime, you can find the similar folder such as {AnypointStudio Folder}/Contents/Eclipse/plugins/org.mule.tooling.server.4.3.0.ee_7.3.5.202005112043/mule/lib/boot
  2. Download the same version of log4j-jul-2.xx.x.jar from public maven repository. For example, for Mule4.3.0, it's log4j-jul-2.13.1.jar
  3. Put the log4j-jul-2.xx.x.jar into {MULE_HOME}/lib/boot
  4. In the Mule4 App, add the corresponding java.util.logging category as per the logging level mapping documented on https://logging.apache.org/log4j/log4j-2.2/log4j-jul/index.html. For example, for verbose logging of org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter, the following can be put in log4j2.xml:
    <AsyncLogger name="org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter" level="ALL"/>
  5. In Mule 4 Runtime wrapper.conf, add the following 2 settings
    wrapper.java.additional.<n>=-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager
    wrapper.java.additional.<n>=-Djava.locale.providers=CLDR
  6. Restart the Mule 4 runtime server, deploy and run the app to get the java.util.logging.Logger logs in the Mule App log.
  7. For Anypoint Studio, the following JVM command line arguments need to be added when running the App:
    -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager -Djava.locale.providers=CLDR
Nummer des Knowledge-Artikels

001116569

 
Laden
Salesforce Help | Article