Skip to main content
Kubernetes Dashboard provides a convenient interface for viewing and downloading container logs. This guide covers how to access logs, apply filters, and troubleshoot common issues.

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:
  1. Navigate to WorkloadsPods
  2. Click on a pod name
  3. Click the Logs icon in the action bar
  4. Select the container (if multiple containers exist)

Log Viewer Interface

The log viewer provides several controls:

Container Selection

For pods with multiple containers:
Use the dropdown to switch between:
  • 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:
1

Enable Previous Logs

Check the “Previous” checkbox in the log viewer
2

Review Crash Logs

Examine logs from the container before it crashed
Previous logs are only available if the container was restarted due to a crash or termination. They’re lost when the pod is deleted.

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

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:
1

Open Log Viewer

Navigate to the logs for your container
2

Click Download

Click the download icon in the log viewer toolbar
3

Save File

Logs are downloaded as a .txt file with timestamps

Log File Streaming

For large log files, Dashboard streams directly to avoid memory issues (modules/api/pkg/resource/container/logs.go:114-125):
The stream is piped directly to the HTTP response, preventing memory exhaustion.

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

1

Identify Failed Pod

Navigate to the pod list and look for pods with error status
2

View Recent Logs

Open logs from the end to see recent error messages
3

Check Previous Logs

If the container crashed, enable “Previous” to see logs before the crash
4

Download for Analysis

Download logs to search for patterns or share with your team

Investigating Startup Issues

1

Select Beginning Position

View logs from the beginning of the container lifecycle
2

Review Initialization

Check init container logs for startup failures
3

Verify Configuration

Look for configuration loading errors or missing environment variables

Monitoring Application Activity

1

Enable Auto-Refresh

Manually refresh the log view to see new entries (auto-follow coming soon)
2

Filter by Container

Switch between containers to monitor different aspects of your application

Troubleshooting

Dashboard limits log retrieval to prevent memory issues:
  • From End: 5000 lines maximum
  • From Beginning: 500KB maximum
Use kubectl logs for complete log access:
Check RBAC permissions:
Ensure your service account has the get permission for pods/log.
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
Large log files take time to retrieve. Optimize by:
  • Reducing log verbosity
  • Implementing log rotation
  • Using structured logging
  • Configuring shorter retention periods

Best Practices

Implement JSON logging for better parsing and filtering:
  • Production: INFO or WARNING
  • Staging: DEBUG
  • Development: TRACE/DEBUG
Prevent disk space issues by configuring container log rotation:
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
For advanced log analysis, integrate with tools like:
  • ELK Stack (Elasticsearch, Logstash, Kibana)
  • Grafana Loki
  • Splunk
  • Datadog

Next Steps

Shell Access

Execute commands in running containers

Monitoring Metrics

View resource utilization and performance data