fermyon / cloud-plugin

A Spin plugin for the Spin CLI for managing Spin apps in Fermyon Cloud.
https://developer.fermyon.com/cloud/
Apache License 2.0
8 stars 13 forks source link

Using the `--since` flag in `cloud logs` doesn't show the expected logs. #163

Open mikkelhegn opened 11 months ago

mikkelhegn commented 11 months ago

When using the --since flag, I always get the latest 10 logs, not the logs since the timeframe desired.

vdice commented 1 month ago

Apparently the default of 10 log lines comes from the --tail flag, even when not used:

        --tail <tail>
            Number of lines to show from the end of the logs [default: 10]

So, to get more than 10 logs when using --since, you'd want to supply --tail N:

$ spin cloud logs nuevo --since 365d --tail 25 | wc -l
25
bacongobbler commented 1 month ago

IIRC the limit was put in place because our internal infrastructure needs to be refactored before we could tie another dependency to it, so we decided to restrict the number of logs we show to a very restricted amount.

If we decide to proceed with those infrastructure improvements (more specifically our log journal system), we should be able to raise that default limit, and therefore --since would work as expected.

bacongobbler commented 1 month ago

Maybe there's a bit of a misunderstanding. If you enter the following:

spin cloud logs nuevo --since 365d

Do you expect the first 10 logs to start from 365 days ago? As in, you expect it to show logs from one year in the past, rather than logs up to one year ago?