Skip to main content
Stagehand provides comprehensive logging capabilities to help you debug automation workflows, track execution, and diagnose issues. Configure logging levels, structured output, and debugging tools for both development and production environments.

Logging Configuration

Verbose Levels

  • Level 0: Errors only - minimal output for production
  • Level 1: Info - includes successful operations and important events
  • Level 2: Debug - comprehensive logging including internal operations

Structured Logging

Log Line Format

Each log entry contains structured information:

Custom Logger

Detailed Logging Features

LLM Inference Logging

Enable detailed logging of all LLM interactions:
The inference_summary/ directory structure:

Log Analysis & Debugging

Common Log Patterns

Best Practices

  • Use verbose: 2 with visual debugging
  • Enable browser DevTools for element inspection
  • Use logInferenceToFile: true to capture LLM decisions
  • Implement structured logging early
  • Use verbose: 1 to balance visibility with performance
  • Implement error tracking and alerting
  • Use structured JSON logging
  • Monitor session success rates and execution times
  • Never log credentials or sensitive data
  • Implement log retention policies
  • Secure log files and dashboards