---
schema_version: "1"
id: b761bee88cb20dc5bcd77c7e8c4b9461385ab958d19c743395cf2dff1d8fda41
title: Configuring Mule Stack Traces
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/mule-runtime/4.12/configuring-mule-stacktraces.md
canonical_url: https://docs.mulesoft.com/mule-runtime/4.12/configuring-mule-stacktraces
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 546b60725b2630093a9de05e6cb0fcceb713262cc6ac33237f68175e556b7436
description: MuleSoft Documentation Site
release: "4.12"
latest: false
---
---
product: Mule Runtime
version: 4.12
keywords: anypoint, studio, mule, on premises, on premise, amc, logs, stack traces, verbose
---

# Configuring Mule Stack Traces

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Mule does not display all stack traces by default. When Mule does show stack traces, it filters out
some internal class references from to produce a more readable output.

You can control Mule stack trace behavior in two ways:

- Use command-line arguments

- Set properties in Mule Studio

## Use Command-Line Arguments

Use `-M-DpropertyName` with the following command-line arguments to control the behavior of stack
traces:

- `mule.verbose.exceptions` - If set to **true**, Mule shows filtered stack traces.

- `mule.stacktrace.filter` - A comma-separated list of packages and/or classes to remove from the
  stack traces, which are matched using `string.startsWith()`.

> [!NOTE] These arguments are available for Mule developers and administrators to use while
> troubleshooting. They are not intended for use by end users.

## Set Properties in Anypoint Studio

In Studio, you can set the properties specified above to instruct Mule to provide stack traces and
to filter out packages or classes to remove. To adjust these settings:

1.  Select **Run** > **Run Configurations…​**

2.  Define the properties to specify the behavior you want.

In the example below, the `mule.verbose.exceptions` property is set to **true**.

![A configuration panel including VM arguments](/mulesoft/current/en-us/mule-runtime/4.12/_images/stack-traces-studio.png)

## Obtain the Stack Trace and Thread Dump

Follow these steps to troubleshoot Mule if it stops and you need more information to find the cause:

1.  Identify the Mule process ID (`MULE_PID`).

2.  Retrieve the thread dump.

3.  Retrieve the heap dump if the Mule server throws an Out Of Memory error:
    `java.lang.OutOfMemoryError: Java heap space`

### Identify the Mule process ID

To identify the Mule process ID, use the Unix/Linux `ps` command, or execute the `jps` command from
the terminal. The `jps` tool ships with the JDK used to run Mule. For example, a line containing
`MuleContainerBootstrap`, `ApplicationDeployer`, or similar identifies the Mule process.

### Retrieve the Thread Dump

Use the `jstack` tool, which is available in modern JDKs, to retrieve the thread dump:

jstack -l MULE\_PID > filename.tdump

### Retrieve the Heap Dump

Retrieve the heap dump if the Mule server throws an out of memory error:
`java.lang.OutOfMemoryError: Java heap space`

The Oracle JVM provides a JVM modifier to gather this information. You must restart the Mule server
after applying this change and reproduce the out of memory error one more time.

To apply this modifier to the JVM that Mule uses, set the following parameters in Mule’s
`/conf/wrapper.conf` file to automatically trigger the creation of a heap dump:

wrapper.java.additional.<n>=-XX:+HeapDumpOnOutOfMemoryError
wrapper.java.additional.<n+1>=-XX:HeapDumpPath=path/to/dumps

When you set the parameters, change <n> to a number that follows the sequence in `wrapper.conf`.

> [!NOTE] By default, Mule includes the `HeapDumpOnOutOfMemoryError` property, but it does not
> define a path for heap dumps.

If no path is defined for a heap dump, the file is created in the directory where the java process
was launched. The heap dump file is then generated as `java_pid<pid>.hprof.<unique number>`.
