Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for streaming container logs from services #285

Merged
merged 5 commits into from
Jun 20, 2024

Conversation

smlx
Copy link
Member

@smlx smlx commented Jul 28, 2023

Checklist

  • Affected Issues have been mentioned in the Closing issues section
  • Documentation has been written/updated.
  • Changelog entry has been written

This PR adds support for this new log access feature in ssh-portal: uselagoon/lagoon-ssh-portal#243
It allows you to access container logs from any Lagoon environment that you have permission to SSH to, via the command line.

The command can either collect existing logs, or "follow" live logs via -f.

Please do not merge this until uselagoon/lagoon-ssh-portal#243 is merged, and lagoon-charts is updated to a version with this feature.

Changelog Entry

Feature - access logs from the CLI (#232)

Closing issues

Closes: #232

@seanhamlin
Copy link
Collaborator

This would be amazing, several customers have mentioned that having to wait for ElasticSearch to have logs can be 30-60 seconds delay, and the logs can be out of order. Having more real time logs, in the correct order would be ace.

@shreddedbacon
Copy link
Member

It is coming, just need support for the feature in the charts.

@shreddedbacon shreddedbacon changed the title Implement logs command Feature: add support for streaming container logs from services Apr 11, 2024
@shreddedbacon shreddedbacon changed the title Feature: add support for streaming container logs from services feat: add support for streaming container logs from services Apr 11, 2024
@shreddedbacon
Copy link
Member

The only thing I wanted to verify before merging this was the error someone would get if the ssh-portal does not have support for logs enabled yet. And the failure message isn't that great.

Error: couldn't dial SSH: ssh: handshake failed: knownhosts: key mismatch
exit status 254

I'm not sure if there is a better way to determine if the logs endpoint is just disabled or not though from the error, as this gives the impression that the SSH service has an issue, but using ssh works.

@shreddedbacon
Copy link
Member

I can update the default return message for the dial error that mentions that it is possible that the logs endpoint is just disabled though, but it would show for all dial errors

pkg/lagoon/ssh/main.go Outdated Show resolved Hide resolved
@shreddedbacon shreddedbacon merged commit ad254f4 into main Jun 20, 2024
4 checks passed
@shreddedbacon shreddedbacon deleted the logs branch June 20, 2024 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new command A new command for the application
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lagoon logs command
3 participants