Logs View¶
The Logs View provides real-time streaming and viewing of Torrentarr's log files. Monitor application activity, debug issues, and track system events through an intuitive interface with auto-refresh and log file selection capabilities.
Overview¶
Torrentarr generates structured logs for all major components:
- Main.log: Core application events, initialization, shutdown
- WebUI / API logs: ASP.NET Core and API request logs
.log : Per-instance logs (e.g.,Radarr-Movies.log,Sonarr-TV.log) if emitted- Rotated logs: Timestamped backups (e.g.,
Main.log.2025-11-27)
The Logs view provides:
- Real-time streaming: Auto-refresh every 2 seconds when active
- Full log display: Tail of log files with ANSI color support
- Log file selection: Dropdown to switch between available logs
- Download capability: Export logs for offline analysis or bug reports
- Auto-scroll control: Toggle automatic scrolling to bottom
UI Components¶
Log File Selector¶
Location: Top toolbar → Dropdown menu
Select which log file to view from all available .log files in the logs directory.
Available Logs:
| Log File | Description |
|---|---|
Main.log | Core application events, process management, config loading |
WebUI.log | HTTP server logs, API requests, authentication failures |
<ArrName>.log | Per-instance logs for each managed Arr (e.g., Radarr-Movies.log) |
<ArrName>.log.<date> | Rotated log archives (timestamped backups) |
Default Selection: Main.log (falls back to first available log if Main.log doesn't exist)
Log Viewer¶
Location: Main content area
Displays the full content of the selected log file with:
- ANSI Color Support: Preserves terminal colors (red errors, green success, blue info)
- Monospace Font:
Cascadia Code,Fira Code,Consolas,Monaco - Dark Background:
#0a0e14for readability - Line Wrapping: Pre-wrap style for long log lines
- Scroll Container: Full-height with independent scrolling
Example Display:
2025-11-27 10:30:15 | INFO | Torrentarr.Main | Starting Torrentarr 5.0.3
2025-11-27 10:30:15 | INFO | Torrentarr.Main | Loading config from /config/config.toml
2025-11-27 10:30:16 | NOTICE | Torrentarr.Main | Connected to qBittorrent v5.0.2
2025-11-27 10:30:17 | SUCCESS | Torrentarr.Main | Radarr-Movies: API connection successful
2025-11-27 10:30:18 | ERROR | Torrentarr.Main | Sonarr-TV: Connection refused (Host: http://sonarr:8989)
Action Buttons¶
Reload List¶
Location: Top toolbar → Reload List button
Function: Refresh the list of available log files without reloading the current log content.
Use Cases: - After log rotation (new .log.<date> files appear) - When new Arr instances are added (new per-instance logs) - After logs are manually cleared
Endpoint: GET /api/logs
Download¶
Location: Top toolbar → Download button
Function: Download the currently selected log file for offline analysis.
Use Cases: - Attach to GitHub issues or bug reports - Archive logs before rotation - Share with support team
Endpoint: GET /api/logs/<name>/download
Filename: Uses original log filename (e.g., Main.log, Radarr-Movies.log.2025-11-27)
Auto-scroll Toggle¶
Location: Top toolbar → Checkbox with live icon
Function: Enable/disable automatic scrolling to bottom when new log entries appear.
Behavior: - Enabled (default): Scroll to bottom every 2 seconds when new content loads - Disabled: Scroll position locked, allows manual navigation of historical logs - Auto-disable: Automatically disables when user scrolls up manually
Use Cases: - Enable: Monitor real-time activity (search loops, torrent processing) - Disable: Review historical errors, search for specific log entries
Refresh Behavior¶
Auto-Refresh Intervals¶
| Condition | Refresh Interval | Description |
|---|---|---|
| Tab Active + Auto-scroll ON | 2 seconds | Real-time streaming mode |
| Tab Active + Auto-scroll OFF | Paused | No automatic updates |
| Tab Inactive | Paused | Conserves resources when tab is not visible |
Manual Refresh: Click Reload List or switch log files to force immediate update.
Scroll Position Management¶
Auto-scroll Enabled: 1. Log content loads via /api/logs/<name> 2. DOM updated with new content 3. scrollTop set to scrollHeight (scroll to bottom) 4. Process repeats every 2 seconds
Auto-scroll Disabled: - Scroll position frozen at current location - User can manually scroll through historical logs - Re-enabling auto-scroll immediately jumps to bottom
User Scroll Detection: - Scroll event listener monitors scroll position - If user scrolls away from bottom (>10px threshold), auto-scroll disables - Prevents scroll fighting during manual navigation
Log Format¶
Structured Logging¶
Torrentarr uses Serilog (or the host's structured logging) for application logs. Log format and levels are configured in the Host (e.g. Torrentarr.Host / Program.cs). Check the codebase for the exact format pattern and level names.
Log Levels¶
Torrentarr supports standard log levels (e.g. Serilog: Verbose, Debug, Information, Warning, Error, Fatal). Check config for ConsoleLevel or equivalent. Colors in the viewer map level to ANSI/HTML as in the table below.
ANSI Color Codes¶
The Logs view preserves ANSI color codes from terminal output:
Foreground Colors:
\033[31m → Red (errors)
\033[32m → Green (success)
\033[33m → Yellow (warnings)
\033[34m → Blue (info)
\033[36m → Cyan (notice)
\033[90m → Dim gray (debug)
Background Colors:
Styles:
Rendering: - ANSI codes converted to inline HTML <span style="..."> tags - Colors mapped to hex values (e.g., \033[31m → color:#cd3131) - Newlines converted to <br> tags - Final HTML rendered with dangerouslySetInnerHTML (safe, server-controlled content)
API Endpoints¶
GET /api/logs¶
Description: List all available log files in the logs directory.
Authentication: Requires Authorization: Bearer header (if WebUI.Token is set)
Response:
{
"files": [
"Main.log",
"WebUI.log",
"Radarr-Movies.log",
"Sonarr-TV.log",
"Main.log.2025-11-27",
"Radarr-Movies.log.2025-11-26"
]
}
Sorting: Files sorted alphabetically (.log files appear before .log.<date>)
GET /api/logs/:name¶
Description: Stream the full content of a specific log file.
Authentication: Requires Authorization: Bearer header (if WebUI.Token is set)
Path Parameters: - name: Log filename (e.g., Main.log, Radarr-Movies.log.2025-11-27)
Response: - Content-Type: text/plain; charset=utf-8 - Body: Full log file content (raw text)
Example:
GET /api/logs/Main.log HTTP/1.1
Authorization: Bearer <token>
HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8
Cache-Control: no-cache
2025-11-27 10:30:15 | INFO | Torrentarr.Main | Starting Torrentarr 5.0.3
2025-11-27 10:30:15 | INFO | Torrentarr.Main | Loading config from /config/config.toml
...
Error Handling: - 404 Not Found: Log file does not exist - 401 Unauthorized: Invalid or missing token
Performance: - Reads entire file into memory (use cautiously with large logs) - Encoding errors ignored (errors="ignore") - No partial reads or byte-range support
GET /api/logs/:name/download¶
Description: Download a log file as an attachment.
Authentication: Requires Authorization: Bearer header (if WebUI.Token is set)
Path Parameters: - name: Log filename
Response: - Content-Disposition: attachment; filename="<name>" - Body: Full log file content
Example:
GET /api/logs/Main.log/download HTTP/1.1
Authorization: Bearer <token>
HTTP/1.1 200 OK
Content-Disposition: attachment; filename="Main.log"
Content-Type: application/octet-stream
<log file contents>
Use Cases: - Attach to bug reports - Archive before log rotation - Share with support team
Log Rotation¶
Torrentarr uses rolling file sinks (e.g. Serilog rolling file) for automatic log rotation. Check Host configuration for max file size and retained file count.
Configuration¶
Log Level¶
Path: Settings.ConsoleLevel Type: string Default: INFO Valid Values: CRITICAL, ERROR, WARNING, NOTICE, INFO, DEBUG, TRACE
Controls the minimum log level written to console and log files.
Example (config.toml):
Runtime Change (via WebUI): 1. Navigate to Config tab 2. Open Settings section 3. Change Console Level dropdown 4. Click Save + Live Reload
Or via API:
curl -X POST http://localhost:6969/api/loglevel \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"level": "DEBUG"}'
Log Directory¶
Native Install:
Docker Install:
Custom Path: Not configurable (hardcoded to HOME_PATH / "logs")
Logging Toggle¶
Path: Settings.Logging Type: bool Default: true
Enable/disable file logging entirely (console output continues).
Example (config.toml):
⚠️ Warning: Disabling logging removes all audit trail and makes debugging impossible.
Troubleshooting¶
"Select a log file to view its tail..."¶
Cause: No log file selected or selected file is empty.
Solution: 1. Check Log File dropdown has a selection 2. Click Reload List to refresh available logs 3. Verify logs directory exists (~/logs or /config/logs) 4. Check Settings.Logging = true in config
Log viewer shows "Loading logs..." indefinitely¶
Cause: API request to /api/logs/<name> is failing.
Solutions: 1. Check browser console for HTTP errors (F12 → Console) 2. Verify log file exists in logs directory 3. Check file permissions (Torrentarr must have read access) 4. Test endpoint manually:
ANSI colors not displaying¶
Cause: Log file missing ANSI escape codes (plain text).
Solutions: - Increase Settings.ConsoleLevel to DEBUG or TRACE (more colorful output) - Check logger configuration (e.g. Serilog in Torrentarr.Host) — color/detail may be configurable - Verify terminal emulator supports ANSI colors (if running Torrentarr manually)
Auto-scroll not working¶
Cause: User scrolled away from bottom, disabling auto-scroll.
Solution: 1. Re-enable Auto-scroll checkbox in toolbar 2. Scroll manually to bottom (auto-scroll re-enables automatically) 3. Refresh page to reset scroll state
Log file too large (slow loading)¶
Cause: Log file exceeds 10 MB before rotation.
Solutions: 1. Wait for automatic rotation (happens at 10 MB) 2. Download log and clear:
3. ReduceSettings.ConsoleLevel to INFO or WARNING (less verbose) Missing per-instance logs (e.g., Radarr-Movies.log)¶
Cause: Instance not managed (Managed = false) or not yet started.
Solutions: 1. Verify Managed = true in config for the Arr instance 2. Check Processes tab shows instance is running 3. Wait 30-60 seconds after instance starts (log file created on first write) 4. Restart Torrentarr to reinitialize loggers
Performance Considerations¶
Large Log Files¶
Problem: Reading 100+ MB logs causes high memory usage and slow response times.
Solutions: 1. Enable Log Rotation: Logs automatically rotate at 10 MB (hardcoded) 2. Manually Archive: Move old logs out of logs directory 3. Reduce Log Level: Change Settings.ConsoleLevel to INFO or WARNING 4. Download and Clear: Download log, then delete original file
Future Enhancement: Implement server-side tail (last N lines only) to avoid full-file reads.
Auto-Refresh Overhead¶
Problem: Fetching full log every 2 seconds with large logs.
Current Behavior: - Full file read on every refresh (no delta/diff) - 2-second interval when auto-scroll enabled - Pauses when tab inactive (Page Visibility API)
Optimization Tips: 1. Disable auto-scroll when not actively monitoring 2. Close Logs tab when not in use (pauses refresh) 3. Use tail -f directly on server for long-term monitoring:
Best Practices¶
Debugging Arr Connections¶
- Navigate to Logs tab
- Select
<ArrName>.log(e.g.,Radarr-Movies.log) - Enable Auto-scroll
- Watch for:
Connection refused→ Check URI and port401 Unauthorized→ Check API key404 Not Found→ Verify Arr is running
Monitoring Search Activity¶
- Navigate to Logs tab
- Select instance log (e.g.,
Sonarr-TV.log) - Enable Auto-scroll
- Watch for:
[NOTICE] Searching for: <Title>→ Search initiated[SUCCESS] Found X results→ Search completed[ERROR] No results found→ Missing indexers or releases
Capturing Crash Logs¶
- Before Crash:
- Set
Settings.ConsoleLevel = "DEBUG" - Enable
Settings.Logging = true - After Crash:
- Navigate to Logs → Select
Main.log - Scroll to bottom (crash traceback)
- Click Download → Attach to GitHub issue
Reducing Log Noise¶
- Set
Settings.ConsoleLevel = "INFO"(default) - Avoid
DEBUGorTRACEin production (generates 10x more logs) - Enable log rotation (automatic at 10 MB)
- Archive old logs monthly:
See Also¶
- Processes View – Monitor process status and restart instances
- WebUI Configuration – WebUI settings and authentication
- Troubleshooting Common Issues – Debugging guide
- API Documentation – Full API endpoint reference