Skip to content

Issue #16 - [FEATURE] Add pause/resume functionality for log streaming #33

@rogelio-cmj

Description

@rogelio-cmj

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:

  1. Navigate to a container's log viewer (See Test Application Setup below)
  2. Wait for logs to start streaming and filling the terminal view
  3. Scroll up to examine a specific log entry from a few seconds ago
  4. 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

  1. Go to Dashboard → Docker → Containers

  2. 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"
    • Click "Deploy"
  3. View the logs:

    • Click on your log-generator container
    • Navigate to the "Logs" tab
    • You should see logs appearing every second

Steps To Test

  1. Open the Docker log viewer for any container that generates logs
  2. Verify a pause/play button appears in the log controls
  3. Click the pause button while logs are streaming
  4. Confirm the log display stops updating (scroll position remains stable)
  5. Scroll up and down through the paused logs to confirm stable viewing
  6. Click the play/resume button
  7. Confirm logs continue streaming normally after resume. Change the container or modify log filters (lines, since, etc.)
  8. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions