# Log4j2 logging across deployment options

*MuleSoft Platform Integration Architect Study Guide · Applying DevOps practices and operating integration solutions · Last updated November 13, 2026 · https://www.certifyforce.com/study-guide/mulesoft-platform-integration-architect/applying-devops-practices-and-operating-integration-solutions/log4j2-logging-across-deployment-options*

Design Log4j 2 logging for Mule applications on customer-hosted runtimes, CloudHub 1.0, CloudHub 2.0 and Runtime Fabric: asynchronous versus synchronous logging, what each platform keeps and how long, how to switch on custom appenders, and how to raise log levels for packages such as batch.

- Certification: Salesforce MuleSoft Platform Integration Architect
- Exam section: Applying DevOps practices and operating integration solutions
- Study guide: https://www.certifyforce.com/study-guide/mulesoft-platform-integration-architect

**Official exam objective:**

> Design the logging configurations and options of Mule applications in all deployment options.

## What the exam expects

- Choose asynchronous or synchronous logging, and handle asynchronous logging failures on customer-hosted runtimes.
- Send CloudHub 1.0 application logs to an external system while keeping them visible to MuleSoft, and size retention against CloudHub's limits.
- Predict which CloudHub 2.0 and Runtime Fabric appenders work, which are removed, and where logs stay visible with a custom configuration.
- Raise log levels for a package per environment, including batch record-level failures and Maven-driven CloudHub 2.0 deployments.

**Application log**: the per-app log defined by the app's `log4j2.xml`. **Runtime log**: `mule_ee.log`, which records app and lifecycle events. **Appender**: the Log4j 2 element that decides where log events go. **Asynchronous logging**: logging on a separate thread so message processing does not wait ([Configuring Logging](https://docs.mulesoft.com/mule-runtime/latest/logging-in-mule)).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| Default logging | Asynchronous, INFO and above. | [Configuring Logging](https://docs.mulesoft.com/mule-runtime/latest/logging-in-mule) |
| Custom async failure handler | `AsyncLoggerConfig.ExceptionHandler` names an LMAX `ExceptionHandler` class. | [Configuring Logging](https://docs.mulesoft.com/mule-runtime/latest/logging-in-mule) |
| CloudHub 1.0 retention | 100 MB per app per worker or 30 days, whichever first. | [View Log Data](https://docs.mulesoft.com/cloudhub/viewing-log-data) |
| CloudHub 1.0 custom logging | Disable CloudHub logs; keep `Log4J2CloudhubLogAppender`. | [CloudHub Log4j integration](https://docs.mulesoft.com/cloudhub/custom-log-appender) |
| CloudHub 1.0 logs disabled | Only system logs in Runtime Manager; no worker log download. | [CloudHub Log4j integration](https://docs.mulesoft.com/cloudhub/custom-log-appender) |
| CloudHub 2.0 Console | Console logging is disabled by default. | [CloudHub 2.0 Log4j integration](https://docs.mulesoft.com/cloudhub-2/ch2-integrate-log-system) |
| CloudHub 2.0 tracing logs | Third-party appenders only. | [CloudHub 2.0 Log4j integration](https://docs.mulesoft.com/cloudhub-2/ch2-integrate-log-system) |
| CloudHub 2.0 log level change | Apply Changes restarts the app. | [Managing App Logs](https://docs.mulesoft.com/cloudhub-2/ch2-manage-app-logs) |
| Runtime Fabric custom Log4j | Disabled by default; `CUSTOM_LOG4J_ENABLED`. | [Exporting Telemetry Externally](https://docs.mulesoft.com/runtime-fabric/latest/use-log4j-appender) |
| All three platforms | Asynchronous appenders only. | [CloudHub Log4j integration](https://docs.mulesoft.com/cloudhub/custom-log-appender), [CloudHub 2.0 Log4j integration](https://docs.mulesoft.com/cloudhub-2/ch2-integrate-log-system), [Exporting Telemetry Externally](https://docs.mulesoft.com/runtime-fabric/latest/use-log4j-appender) |
| Batch record details | `com.mulesoft.mule.runtime.module.batch` at DEBUG. | [Batch errors](https://docs.mulesoft.com/mule-runtime/latest/batch-error-handling-faq) |

## Check yourself

- Why does a CloudHub 1.0 log entry show a different hour in the console from the stored record?
- When you filter CloudHub 1.0 logs by time through the CloudHub API, what format do `startTime` and `endTime` require?
- When the same error hits records in two different batch steps at the default level, how many detailed entries appear?
- How long does CloudHub 1.0 keep the history of inactive deployments?

## Sources

- [Configuring Logging](https://docs.mulesoft.com/mule-runtime/latest/logging-in-mule)
- [Logging](https://docs.mulesoft.com/mule-runtime/latest/tuning-logging)
- [Integrate with Your Logging System Using Log4j (CloudHub)](https://docs.mulesoft.com/cloudhub/custom-log-appender)
- [View Log Data](https://docs.mulesoft.com/cloudhub/viewing-log-data)
- [Integrating with Your Logging System Using Log4j (CloudHub 2.0)](https://docs.mulesoft.com/cloudhub-2/ch2-integrate-log-system)
- [Managing App Logs](https://docs.mulesoft.com/cloudhub-2/ch2-manage-app-logs)
- [Exporting Telemetry Externally](https://docs.mulesoft.com/runtime-fabric/latest/use-log4j-appender)
- [Handling Errors During Batch Job](https://docs.mulesoft.com/mule-runtime/latest/batch-error-handling-faq)
- [Deploy Applications to CloudHub 2.0 Using the Mule Maven Plugin](https://docs.mulesoft.com/mule-runtime/latest/deploy-to-cloudhub-2)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 10 linked practice questions, and unlimited timed mock exams are included with the MuleSoft Platform Integration Architect pack (USD $19): https://www.certifyforce.com/practice-exams
