Skip to main content

Using AutoConfig's debug mode for filter troubleshooting

· 5 min read

AutoConfig job filters can be hard to diagnose, especially with multiple filters or custom JavaScript. The debug parameter adds verbose logging for filter evaluation so you can see why a pair passes or fails.

Use the AutoConfig wizard

Nearly every option that follows can be set without editing files by hand.
Click the (three-dots) menu ➜ AutoConfig, step through the wizard, and press Save; it will write a correct autoconfig.json for you.

The Purpose of debug Mode

debug adds detailed, step-by-step logging for filter evaluation in a single AutoConfig job. It helps you see:

  • Why a pair fails an addPairs filter set.
  • Why an override isn’t applied in manageOverrides.
  • Intermediate values inside a custom JavaScript filter.
  • How filters interpret market data or variables.

How to Enable debug Mode

Set the boolean debug at the top level of the job definition in autoconfig.json.

{
"pairFilterTest": {
"enabled": true,
"type": "addPairs", // Or any other job type that uses filters
"schedule": "*/5 * * * *",
"debug": true, // User setting: Enable verbose filter logging for this job
"pairs": {
"exchange": "binance",
"include": "USDT-BTC,USDT-ETH"
},
"filters": {
"volumeCheck": {
"filterType": "minVolume24h",
"minVol": 1000000
},
"spreadCheck": {
"filterType": "maxSpreadPct",
"maxSpread": 0.1
},
"customLogic": {
"filterType": "custom",
"script": " console.log('Custom filter for ' + this.pairName + ': Checking this.variables.myFlag: ' + this.variables.myFlag); return this.variables.myFlag === true && this.tickers[this.config.AutoConfig.pairFilterTest.jobName][this.tickers[this.config.AutoConfig.pairFilterTest.jobName].length-1][this.pairName].ask > 20000;"
}
},
"strategy": "spotgrid"
}
}

Interpreting debug Mode Output

With debug: true, Gunbot logs extra lines for each pair and filter, usually in the console and in gunbot_log.txt and/or autoconfig-log.txt (depending on version and logging setup). Logs typically include:

  • Pair being evaluated
  • Filter rule and type
  • Data values used in comparisons
  • Result (pass/fail)
  • console.log() output from custom filters

Example Log Snippets (Conceptual):

[INFO] AutoConfig: Job pairFilterTest - Evaluating pair USDT-BTC
[DEBUG] AutoConfig: Job pairFilterTest - Filter volumeCheck (minVolume24h) for USDT-BTC. Pair Volume: 1500000, Threshold: 1000000. Result: true
[DEBUG] AutoConfig: Job pairFilterTest - Filter spreadCheck (maxSpreadPct) for USDT-BTC. Pair Spread: 0.05, Threshold: 0.1. Result: true
[DEBUG] AutoConfig: Job pairFilterTest - Filter customLogic (custom) for USDT-BTC.
Custom filter for USDT-BTC: Checking this.variables.myFlag: true // Output from console.log in script
[DEBUG] AutoConfig: Job pairFilterTest - Filter customLogic (custom) for USDT-BTC. Script returned: true. Result: true
[INFO] AutoConfig: Job pairFilterTest - Pair USDT-BTC passed all filters.
...
[INFO] AutoConfig: Job pairFilterTest - Evaluating pair USDT-ETH
[DEBUG] AutoConfig: Job pairFilterTest - Filter volumeCheck (minVolume24h) for USDT-ETH. Pair Volume: 800000, Threshold: 1000000. Result: false
[INFO] AutoConfig: Job pairFilterTest - Pair USDT-ETH failed filterSet 1 at rule volumeCheck.

This trace shows which filter blocked or allowed a pair and the values used in that decision.

When to Use debug Mode

  • Developing New Filters: Use a small pairs.include list to verify logic quickly.
  • Unexpected Behavior: Check why a job isn’t adding or removing pairs as expected.
  • Troubleshooting Custom Scripts: Combine debug: true with your own console.log() statements.
  • Validating Data: Confirm ticker or variable data matches what you expect.

Important Considerations

  • Log Verbosity: Debug logs are noisy, especially with frequent schedules or many pairs.
  • Disable After Use: Set debug: false once troubleshooting is complete.
  • Performance: High-frequency jobs with debug logging can add overhead.
  • Focus on One Job: Enable debug only on the job you are diagnosing.

Use debug when you need to see the full filter evaluation path, then disable it to keep logs clean.