Fork me on GitHub

Trace Flags
Apex Checkpoints

Debug Logs ("Trace Flags")

Trace flags can be set up to generate debug logs captured during Apex unit tests and Apex execution.

To create a new trace flag to generate debug logs, you can either:

  1. Use the Trace Flag UI
  2. Create trace flag(s) based on configuration in your project's config/.debug file.

Trace Flag UI

  1. Select MavensMate > Debug > New Debug Log.... This will open the UI that allows you to select a user, log levels, and duration of the trace flag.

Quick Log Setup

The "quick log" functionality allows you to create trace flags based on settings defined in your project's config/.debug configuration.

  1. Select MavensMate > Debug > New Quick Log or control + shift + L
    "levels": {
        "Workflow": "INFO", 
        "Callout": "INFO", 
        "System": "DEBUG", 
        "Database": "INFO", 
        "ApexCode": "DEBUG", 
        "Validation": "INFO", 
        "Visualforce": "DEBUG"
    "users": [
        "005b0000000ThFMAB0" //array of user ids
    "expiration": 60 //in minutes

Fetching Debug Logs

To fetch debug logs to your project, select MavensMate > Fetch Logs or control + shift + K. Any logs will be placed in your project's debug/logs directory. You must have an active Trace Flag in place in order for Debug Logs to be generated.

Apex Checkpoints

Apex Checkpoints are locations in an Apex Class where you wish the platform to dump information at runtime, like variable values.

Creating Apex Checkpoints

To create an Apex Checkpoint, select MavensMate > Debug > New Apex Checkpoint. You will then be prompted to select a line number on which to create the checkpoint.

Retrieving Heap Dumps

To fetch checkpoint results to your project, select MavensMate > Fetch Checkpoints. Any checkpoint results will be placed in your project's debug/checkpoints directory.