Godot 4 Plugin

The Forge Logger plugin for Godot 4 integrates bug reporting and runtime diagnostics directly into your game. Sessions are created automatically on startup, bug reports can be triggered programmatically or via an in-game popup, and all data is sent to the Forge Logger backend.

Features

  • Automatic session creation on game start (linked to build version and platform)
  • Programmatic bug reports with title, description, severity, tags, and custom data
  • User-facing in-game report popup (show_report_popup())
  • Log file and screenshot upload via pre-signed URLs
  • Offline retry queue – failed requests are retried on the next launch
  • Crash detection – abnormal terminations are reported on the next run

Installation

  1. Copy the addons/forge_logger directory from this repository into the addons/ folder of your Godot project.
  2. In the Godot editor open Project → Project Settings → Plugins and enable Forge Logger.
  3. Configure the plugin under Project Settings → forge_logger/:
SettingDescription
base_urlBackend URL, e.g. https://api.your-forge-logger.com or http://localhost:3000.
project_idUUID of your project (from the web dashboard or API).
api_keyBearer token for authentication. Leave empty for public backends.
game_nameName shown in the dashboard next to reports.
game_versionSemantic version string, e.g. 1.0.0.
build_hashGit commit hash or build identifier.
environmentdevelopment, staging, or production.
enable_logsAttach the Godot log file to each report.
enable_screenshotCapture a screenshot automatically with each report.
auto_start_sessionStart a session immediately on launch (recommended).

Usage

Automatic session start

When auto_start_session is enabled the plugin calls start_session() as part of its _ready() lifecycle. No extra code is needed.

To start a session manually (when auto_start_session is off):

await ForgeLogger.start_session()

Programmatic bug report

ForgeLogger.capture_bug({
    "title": "Player stuck in wall",
    "description": "Dash caused collision lock near checkpoint 3",
    "severity": "high",
    "tags": ["movement", "collision"],
    "custom_data": {
        "scene": get_tree().current_scene.name,
        "player_position": str(player.global_position),
    }
})

User-facing report popup

ForgeLogger.show_report_popup()

This opens a built-in UI where the player can describe the bug. The plugin collects the form data and submits a report automatically.

Utilities

# Retry all requests that failed while offline
ForgeLogger.retry_queued()
 
# Verify connectivity to the backend
await ForgeLogger.check_health()

Plugin Structure

You do not need to understand the internals to use the plugin, but knowing where things live helps if you want to extend it:

FilePurpose
forge_logger.gdAutoload singleton – the public API surface.
session_manager.gdCreates and tracks the current session; detects crashes.
upload_manager.gdCollects log files and manages pre-signed upload URLs.
report_builder.gdAssembles the report payload from all collected data.
forge_logger_http_client.gdLow-level HTTP wrapper around the REST API.

Custom Integration

ForgeLoggerHttpClient can be used independently of the autoload singleton. This is useful if you want to send custom events or query data:

var client := ForgeLoggerHttpClient.new()
client.base_url = "https://api.your-forge-logger.com"
client.api_key = "<TOKEN>"
 
# Available methods:
# client.start_session(project_id, payload)
# client.create_upload(project_id, payload)
# client.submit_report(project_id, payload)
# client.list_reports(project_id)
# client.get_events(project_id, session_id)
# client.post_events(project_id, events_array)
# client.check_health()

Best Practices

  • Enrich reports – always provide title, description, severity, and custom_data (scene name, checkpoint, player position). Detailed reports are much easier to reproduce.
  • Do not hard-code api_key – load it from an environment variable or an encrypted store. Committed API keys can be rotated but the history remains in git.
  • Use environment setting – tag builds as development / staging / production so reports are easy to filter in the dashboard.

For endpoint details and examples in other languages see the API Reference.