Debug Logging
Debug logging must be configured to see more detailed “debug” level logs.
By default, FileBrowser logs all INFO, ERROR, WARNING, and API events to stdout with colors enabled. No configuration is required for basic logging.
Enable Debug Logging
Simply add debug to the levels in your config.yaml:
Log Levels
| Level | Description |
|---|---|
error | Only error messages |
warning | Warnings and errors |
info | General information (default) |
debug | Detailed debugging information including file/line numbers |
api | API request/response logs (via apiLevels) |
Log levels can be specified using multiple separators: "info|warning|error" or "info warning error" or "info,warning,error". Use whichever you prefer.
When debug logging is enabled, all log types will include the exact file and line number that caused the log event, not just debug logs.
What Debug Logging Shows
When debug logging is enabled, you’ll see detailed information about:
- HTTP request/response details
- File operations and permissions
- Authentication attempts
- Database queries
- Share creation and access
- Integration operations (OnlyOffice, FFmpeg)
- Exact file and line numbers for all log events
Logging Configuration Examples
Default Behavior (No Config Required)
If you don’t configure logging, you get this by default:
This gives you INFO, WARNING, ERROR, and API logs to stdout with colors.
Enable Debug Logging
File Output
Log to a file:
Structured JSON Logging
Enable JSON structured logs for log aggregation tools:
Multiple Log Outputs
You can have multiple file loggers and one stdout logger:
| |
You can have as many file output loggers as you want, but only one stdout logger. If you configure multiple stdout loggers, only the first one will be used.
API-Specific Logging
Configure separate log levels for API requests:
Or disable API logs entirely:
Complete Production Example
For production environments, recommended logging configuration:
| |
Special Log Behaviors
FATAL Logs
FATAL logs are considered errors and cannot be disabled. FATAL logs always print to console regardless of configuration, as they indicate the program is about to terminate.
Debug Mode Line Numbers
When debug logging is enabled, all log types (not just debug) will include the exact file and line number that caused the log event. This helps with troubleshooting but adds overhead.
Troubleshooting
Terminal Shows Weird Characters
If you see 033[0m or similar text in your logs:
Enable Debug Logging Temporarily
For troubleshooting, temporarily enable debug logging:
Debug logging can generate large amounts of output and includes file/line numbers for all logs. Use it only for troubleshooting and disable it in production to avoid performance impact and disk space issues.
Log Rotation
FileBrowser doesn’t handle log rotation internally. Use external tools like logrotate:
Next Steps
- [Troubleshooting" />}}
- Configuration Reference