-
Notifications
You must be signed in to change notification settings - Fork 160
Description
Motivation
Users working with high-traffic applications struggle to analyze container logs in the Docker log viewer because the constant stream of new log entries causes automatic scrolling. When users scroll up to examine specific log entries, they lose their position as new logs arrive and force the view back to the bottom. This makes it nearly impossible to investigate issues or analyze patterns in busy production environments. A pause/resume feature would allow users to freeze the log display for analysis while continuing to capture incoming logs in the background, ensuring no data is lost while providing a stable viewing experience.
Current Behavior
The Docker log viewer continuously streams logs from containers via WebSocket connection. As new log entries arrive, they are immediately displayed and the view automatically scrolls to show the latest entries. Users cannot stop this behavior to examine historical logs without losing their position.
Reproduction Steps:
- Navigate to a container's log viewer (See Test Application Setup below)
- Wait for logs to start streaming and filling the terminal view
- Scroll up to examine a specific log entry from a few seconds ago
- Observe: The view automatically scrolls back to the bottom as new logs arrive, making it impossible to maintain focus on the entry you were examining
Expected Behavior
The log viewer should provide pause and resume controls that allow users to freeze the display while continuing to buffer incoming logs in the background. When paused, users can scroll, search, and analyze logs without interruption. When resumed, all buffered logs should be applied to the display, ensuring no log entries are lost during the pause period.
Acceptance Criteria:
- A pause/play button is visible in the log viewer interface
- When paused, the log display stops updating even as new logs arrive via WebSocket
- Incoming logs during pause are buffered in memory without being displayed
- When resumed, all buffered logs are applied to the display in the correct order
- The pause state resets when switching between different containers or changing log filters
- Users can scroll freely through logs while paused without the view jumping
Test application Setup (Optional)
If you need a test application which generates logs you can use this setup
-
Go to Dashboard → Docker → Containers
-
Create a new container:
- Click "Create Container"
- Fill in the following:
- Container Name:
log-generator - Image:
busybox - Command:
sh -c "while true; do echo \"[$(date)] Log entry #$RANDOM - Processing request...\"; sleep 1; done"
- Container Name:
- Click "Deploy"
-
View the logs:
- Click on your
log-generatorcontainer - Navigate to the "Logs" tab
- You should see logs appearing every second
- Click on your
Steps To Test
- Open the Docker log viewer for any container that generates logs
- Verify a pause/play button appears in the log controls
- Click the pause button while logs are streaming
- Confirm the log display stops updating (scroll position remains stable)
- Scroll up and down through the paused logs to confirm stable viewing
- Click the play/resume button
- Confirm logs continue streaming normally after resume. Change the container or modify log filters (lines, since, etc.)
- Verify the pause state resets and logs stream normally for the new selection
Submission
Download https://cap.so/ to record your screen (use Studio mode). Export as an mp4, and drag and drop into an issue comment below.
Guide to submitting pull requests: https://hackmd.io/@timothy1ee/Hky8kV3hlx