Skip to content

Add options to fetch all logs, and to follow logs #365

@calavera

Description

@calavera

The new subcommands to fetch logs only return the most recent 100 log lines from a given context, application, request, container...

We could add two new flags for those subcommands to fetch more logs when users need them.

  1. Flag to fetch all logs, --all: To do this, we'd need to add the parameter head to the API call with the number of logs to fetch. This will return logs in ascending order. Then, we'll use the nextToken returned in the response to keep pulling logs until we receive a response without nextToken, meaning that we're consumed all the logs:
v1/namespaces/NAMESPACE/applications/APPLICATION/logs?head=100
  1. Flag to wait, or follow, logs, --follow: This flag will make the cli to wait for incoming logs. Send the first logs request to the server, keep the UUID of the newest entry, sleep for a few seconds, and send the request again. If there are newer entries in the response, print them, and do the loop again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions