Add logs to deploy command? #473

Open
opened 2025-01-07 14:07:59 +00:00 by fauno · 8 comments
Member

When an app fails to converge, you're suggested to run abra app logs but this only shows the latest lines, which don't necessarily indicate what happened. Is it possible to show the logs during deploy, on the same output? That way I could see what failed during deploy, instead of guessing when are logs available (I can't, always seem to get less output that I need)

When an app fails to converge, you're suggested to run `abra app logs` but this only shows the latest lines, which don't necessarily indicate what happened. Is it possible to show the logs during deploy, on the same output? That way I could see what failed during deploy, instead of guessing when are logs available (I can't, always seem to get less output that I need)
Owner

@fauno that's a very interesting idea 🤔 If others support this idea, we could think about wiring up a prototype to test it out. I think it would in theory give more clarity to what is going on?

And to check we're on the same page, if the deployment passes, the logs stop tailing? And if it fails, it stops tailing. And you get the same message at the end as per usual?

The current work-around is something like this after the deployment:

abra app logs <domain> \
  --since "$(date --date='10 minutes ago' -u +'%FT%T.%2NZ')"

But I now notice that this actually hangs with 0 output 😭 That's a 🐛

update: typo, 10 minutes 👉 10 minutes ago works 🎉

@fauno that's a very interesting idea 🤔 If others support this idea, we could think about wiring up a prototype to test it out. I think it would in theory give more clarity to what is going on? And to check we're on the same page, if the deployment passes, the logs stop tailing? And if it fails, it stops tailing. And you get the same message at the end as per usual? The current work-around is something like this after the deployment: ``` abra app logs <domain> \ --since "$(date --date='10 minutes ago' -u +'%FT%T.%2NZ')" ``` ~~But I now notice that this actually hangs with 0 output 😭 That's a 🐛~~ **update**: typo, ~~`10 minutes`~~ 👉 `10 minutes ago` works 🎉
decentral1se added the
enhancement
label 2025-01-07 16:31:30 +00:00
Author
Member

Yeah that should do it! I didn't notice the --since flag :/

Yeah that should do it! I didn't notice the `--since` flag :/
Owner

@fauno cool! actually, it does work 😅 I just had a typo in the obscure date syntax in my comment above. hopefully that helps for now. but yeh, if you could try gather more input on this feature request, it'd be great!

@fauno cool! actually, it does work 😅 I just had a typo in the obscure `date` syntax in my comment above. hopefully that helps for now. but yeh, if you could try gather more input on this feature request, it'd be great!
Owner

#478 feels related.

https://git.coopcloud.tech/toolshed/abra/issues/478 feels related.
Owner

@fauno any ideas how a layout might look in combination with #478 (comment)? (🤯) Ideally we'd have both the status updates from Docker itself and the logs tailing alongside somewhere. We don't have so much screen real estate but I'd love to combine. This could make things finally visible and informative... see #473 (comment)

~~@fauno any ideas how a layout might look in combination with https://git.coopcloud.tech/toolshed/abra/issues/478#issuecomment-22548? (🤯) Ideally we'd have both the status updates from Docker itself and the logs tailing alongside somewhere. We don't have so much screen real estate but I'd love to combine. This could make things finally visible and informative...~~ see https://git.coopcloud.tech/toolshed/abra/issues/473#issuecomment-22579
decentral1se added this to the v0.10.x project 2025-01-11 11:09:45 +00:00
Owner

@fauno a wild idea appears: we can record the start time of the deployment. then, run the deployment. when #478 is implemented we will know for sure if a deployment failed or not. if a deployment fails, we can dump all the logs from all containers since the deployment start time directly without prompt (because you would do this anyway). if the deployment succeeds, we show no logs. how does this sound for a design?

@fauno a wild idea appears: we can record the start time of the deployment. then, run the deployment. when https://git.coopcloud.tech/toolshed/abra/issues/478 is implemented we will know for sure if a deployment failed or not. if a deployment fails, we can dump all the logs from all containers since the deployment start time directly without prompt (because you would do this anyway). if the deployment succeeds, we show no logs. how does this sound for a design?
Author
Member

sounds great!

sounds great!
Owner

Alternatively, taking some parts of what @forest was talking about here we could also log all output of a failed deployment to file in ~/.abra/logs/<server>/<app>_<timestamp> (or something like this) for further inspection (and also ease of scp ... to fellow workers for inspection!

I think that also might be an easier and a more sustainable option, giving people the full overview but then instead of a potentially confusing dump of some limited amount (or worse, too much) of logs in the terminal all at once!

Alternatively, taking some parts of what `@forest` was talking about [here](https://matrix.to/#/!DfXPgKLoYCvjHithgS:autonomic.zone/$sO_fPQUrXwfBWtvDZH7TUjrk0dxCzVsKXn5e5Lo8a_Q?via=autonomic.zone&via=matrix.org&via=cyberia.club) we could also log all output of a *failed deployment* to file in `~/.abra/logs/<server>/<app>_<timestamp>` (or something like this) for further inspection (and also ease of `scp ...` to fellow workers for inspection! I think that also might be an easier and a more sustainable option, giving people the full overview but then instead of a potentially confusing dump of some limited amount (or worse, too much) of logs in the terminal all at once!
decentral1se added the
design
label 2025-01-16 07:46:39 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: toolshed/abra#473
No description provided.