Logging
GQLForge uses a structured logging system built on Rust’s tracing framework. You can control log verbosity and output format to suit your environment.
Log Levels
Set the log level using the RUST_LOG environment variable:
RUST_LOG=info gqlforge start config.graphql
Available levels from most to least verbose:
| Level | Description |
|---|---|
trace | Very detailed internal events, useful for deep debugging |
debug | Diagnostic information for development |
info | General operational messages (default) |
warn | Potential issues that do not prevent operation |
error | Failures that affect request handling |
Filtering by Module
You can set different levels for different modules:
RUST_LOG="gqlforge=debug,hyper=warn" gqlforge start config.graphql
This sets GQLForge’s own logs to debug while keeping the HTTP library logs at warn.
Production Recommendations
- Use
infolevel in production to balance visibility and performance. - Use
debugortraceonly during development or when investigating specific issues. - Combine with the telemetry system for structured observability in production environments.
Example
# Development: verbose output
RUST_LOG=debug gqlforge start config.graphql
# Production: standard output
RUST_LOG=info gqlforge start config.graphql
# Troubleshooting upstream calls
RUST_LOG="gqlforge=trace" gqlforge start config.graphql