Overview
Dashboard streams container logs directly from the Kubernetes API, offering:- Real-time log streaming
- Historical log retrieval
- Multi-container pod support
- Download and filtering capabilities
- Timestamp display
- Log rotation handling
Logs are retrieved using the Kubernetes
pods/log API endpoint with configurable limits to prevent memory issues.Accessing Container Logs
There are multiple ways to access logs in Dashboard:- From Pod Detail
- From Pod List
- From Workload Detail
- Navigate to Workloads → Pods
- Click on a pod name
- Click the Logs icon in the action bar
- Select the container (if multiple containers exist)
Log Viewer Interface
The log viewer provides several controls:Container Selection
For pods with multiple containers:- Init containers: Containers that run during pod initialization
- Application containers: Main application containers
Timestamp Toggle
Show or hide timestamps for each log line:Previous Logs
View logs from crashed containers:Log Retrieval Implementation
Dashboard implements log retrieval with safeguards (modules/api/pkg/resource/container/logs.go:55-75):
Read Limits
To prevent out-of-memory errors, Dashboard enforces limits (modules/api/pkg/resource/container/logs.go:28-32):
From Beginning: Reads up to 500KB
From End: Reads up to 5000 lines
Log Options
Dashboard configures log retrieval (modules/api/pkg/resource/container/logs.go:77-94):
Log Selection Options
Dashboard supports flexible log viewing:Position Selection
- From End (Default)
- From Beginning
Shows the most recent log lines (up to 5000 lines).Use case: Viewing recent activity or current application state
Reference Point
View logs relative to a specific timestamp or line number:Downloading Logs
Download logs for offline analysis:Log File Streaming
For large log files, Dashboard streams directly to avoid memory issues (modules/api/pkg/resource/container/logs.go:114-125):
Log Format
Logs are displayed with optional timestamps:Log Line Processing
Dashboard parses and structures log data (modules/api/pkg/resource/container/logs.go:136-156):
Common Use Cases
Debugging Application Errors
Investigating Startup Issues
Monitoring Application Activity
Troubleshooting
Logs are truncated
Logs are truncated
Dashboard limits log retrieval to prevent memory issues:
- From End: 5000 lines maximum
- From Beginning: 500KB maximum
kubectl logs for complete log access:Cannot access logs
Cannot access logs
Check RBAC permissions:Ensure your service account has the
get permission for pods/log.Previous logs not available
Previous logs not available
Previous logs are only retained until the pod is deleted. For persistent logging:
- Use a log aggregation system (Fluentd, Filebeat)
- Configure persistent log storage
- Enable audit logging
Logs load slowly
Logs load slowly
Large log files take time to retrieve. Optimize by:
- Reducing log verbosity
- Implementing log rotation
- Using structured logging
- Configuring shorter retention periods
Best Practices
Use structured logging
Use structured logging
Implement JSON logging for better parsing and filtering:
Configure appropriate log levels
Configure appropriate log levels
- Production: INFO or WARNING
- Staging: DEBUG
- Development: TRACE/DEBUG
Implement log rotation
Implement log rotation
Prevent disk space issues by configuring container log rotation:
Use log aggregation for production
Use log aggregation for production
Dashboard logs are useful for quick debugging, but use dedicated log aggregation for:
- Long-term retention
- Advanced search and filtering
- Alerting and analysis
- Compliance and audit requirements
Limitations
Be aware of Dashboard log viewer limitations:- No live streaming: Logs don’t auto-refresh (manual refresh required)
- Size limits: 5000 lines or 500KB maximum
- No filtering: Text search requires downloading logs
- Single container: View one container at a time
Next Steps
Shell Access
Execute commands in running containers
Monitoring Metrics
View resource utilization and performance data