Log File Structure
Symphony uses OTP’s built-in rotating disk log handler to write structured logs to disk.Default Location
Logs are written to:log_file.ex:9 (elixir/lib/symphony_elixir/…)
Custom Log Location
Specify a custom log directory using the--logs-root flag:
cli.ex:146-149 (elixir/lib/symphony_elixir/…)
Log Rotation
Symphony automatically rotates log files based on size:log_file.ex:10-11 (elixir/lib/symphony_elixir/…)
Rotation Behavior:
- When
symphony.logreaches 10 MB, it’s rotated tosymphony.log.1 - Older files are rotated:
symphony.log.1→symphony.log.2, etc. - When 5 files exist, the oldest is deleted
Log rotation is handled automatically by OTP’s
:logger_disk_log_h handler. No external tools like logrotate are needed.Log Format
Symphony uses structured logging with a single-line formatter:log_file.ex:71 (elixir/lib/symphony_elixir/…)
Log Entry Example
Log Entry Components
| Component | Description | Example | |-----------|-------------|---------|| | Timestamp | ISO 8601 timestamp with microseconds |2026-03-04T21:45:30.123456Z |
| Level | Log severity level | [info], [warning], [error] |
| Message | Structured log message | Agent task completed for issue_id=... |
| Context | Key-value pairs for filtering | issue_id=abc session_id=xyz |
Log Levels
Symphony uses standard Erlang/OTP log levels:log_file.ex:70 (elixir/lib/symphony_elixir/…)
Available Log Levels
:debug
:debug
Usage: Detailed debugging informationExamples:Source:
orchestrator.ex:169 (elixir/lib/symphony_elixir/…)Debug logs are useful for troubleshooting but can be verbose in production.:info
:info
Usage: Normal operational messagesExamples:Source:
orchestrator.ex:107-127 (elixir/lib/symphony_elixir/…)Info logs track normal operation flow and state transitions.:warning
:warning
Usage: Warning conditions that don’t prevent operationExamples:Source:
orchestrator.ex:117 (elixir/lib/symphony_elixir/…), log_file.ex:47 (elixir/lib/symphony_elixir/…)Warnings indicate potential issues that should be investigated.:error
:error
Usage: Error conditions that prevent specific operationsExamples:Source:
orchestrator.ex:182-196 (elixir/lib/symphony_elixir/…)Errors indicate problems that need immediate attention.Structured Logging Format
Symphony uses key-value pairs for structured logging, making logs easy to parse and filter.Context Fields
Common context fields in log messages: | Field | Description | Example | |-------|-------------|---------|| |issue_id | Internal issue identifier | issue_abc123 |
| issue_identifier | Linear issue identifier | ABC-123 |
| session_id | Codex session identifier | sess_xyz789 |
| reason | Exit or error reason | :timeout, :normal |
| attempt | Retry attempt number | 1, 2, 3 |
Filtering Logs
Usegrep to filter logs by context:
Log Handler Configuration
Symphony configures the disk log handler during application startup:log_file.ex:23-30 (elixir/lib/symphony_elixir/…)
Handler Configuration Options
log_file.ex:68-79 (elixir/lib/symphony_elixir/…)
Console Output
By default, Symphony removes the default console logger when the disk log handler is configured:log_file.ex:60-66 (elixir/lib/symphony_elixir/…)
Removing the console handler prevents duplicate log output. The terminal dashboard provides real-time status instead.
Reading Logs
Real-time Monitoring
Follow logs as they’re written:Log Analysis
Analyze historical logs:Log Aggregation
For production deployments, consider forwarding logs to a centralized logging system:Filebeat Configuration
Filebeat Configuration
filebeat.yml
Vector Configuration
Vector Configuration
vector.toml
Performance Considerations
Log I/O
The disk log handler writes asynchronously to avoid blocking:- Logs are buffered in memory
- Writes are batched for efficiency
- File rotation is handled by OTP’s
:disk_logmodule
In high-throughput scenarios, monitor disk I/O to ensure logging doesn’t become a bottleneck.
Disk Space Management
With default settings, maximum disk usage is:Log Verbosity
To reduce log volume in production:-
Filter debug logs:
-
Adjust handler level:
- Use log sampling for high-frequency events
Troubleshooting Logs
Log Handler Not Configured
Symptom: No log files are created Solution:-
Check that log directory exists and is writable:
-
Verify handler configuration:
- Check for configuration errors in startup logs
log_file.ex:23-50 (elixir/lib/symphony_elixir/…)
Log Files Not Rotating
Symptom: Log file grows beyond configured size Solution: This is unusual as OTP handles rotation automatically. Check:-
Verify max_bytes configuration:
-
Check disk space:
-
Examine handler status:
Missing Log Entries
Symptom: Expected log entries are not present Possible causes:- Log level filtering: Entry level is below configured threshold
- Handler crash: Check if disk log handler is still running
- Disk full: No space to write logs
- Permission errors: Log directory not writable
log_file.ex:47 (elixir/lib/symphony_elixir/…)