IntelliJ IDEA 2018.2 Help

Async Stack Traces

Use this page to configure capture points to facilitate debugging of asynchronous code.

A capture point is a place in your code where the debugger captures stack traces to be used later when you reach a specific point in the code (the insertion point) and want to see how you got there. IntelliJ IDEA does this by substituting part of the call stack with a captured stack. For more information on asynchronous debugging refer to Debugging Asynchronous flow.

Asynchronous stack traces are enabled by default. To disable them, deselect the Instrumenting agent (requires debugger restart) option. The most common capture points are built-in, so no configuration is required.

If you need to use capture points that are not included in the default configuration, you can use the Async.Schedule and Async.Execute annotations that reside in the public JetBrains annotations package and can be referenced in your code. To use them, add this Maven repository as a dependency for your artifacts.

If you cannot use annotations or need to be able to capture local variables, you can configure capture points manually by using the following controls:

Item

Description

icons general add

Click this icon to configure a new capture point. Fill in the following information:
  • Capture class name: enter the name of the class at the top of the stack trace you want to capture.

  • Capture method name: enter the name of the method at the top of the stack trace you want to capture.

  • Capture key expression: enter the capture key expression. The capture key expression is evaluated and the value is used as the key.

  • Insert class name: enter the name of the class where you want to insert the captured stack trace.

  • Insert method name: enter the name of the method where you want to insert the captured stack trace.

  • Insert key expression: enter the key expression that will be evaluated and this value will be matched with the key in the captured stack.

Use the checkbox next to each entry to enable/disable the selected capture point.

icons general remove svg

Click this icon to remove the capture point from the list.

icons actions previousOccurence svgicons actions nextOccurence svg

Click these icons to move the selected item one line up or down in the list.

enable selecteddisable selected

Click these icons to enable/disable all selected capture points.

icons actions copy svg

Click this icon to duplicate the selected entry.

ImportCaptureSettings

Click this icon to import capture point settings from a file.

icons actions export

Click this icon to export capture point settings to a file.

Capture local variables

Select this option if you also want to capture local variables (primitives and String values) together with the call stack. This may sufficiently slow down the debugging process.

Note that this option is unavailable if the Instrumenting agent is enabled

Last modified: 25 October 2018

See Also