This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
Stream entrypoint logs, distinguish app vs system logs, colorize #855
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This modifies the entrypoint to send its logs to the Waypoint server and make them available via
waypoint logs
.I did this because as I was finishing up config syncing I realized its critical to be able to see any errors in syncing config and its a huge PITA on most systems that aren't local Docker.
The server API was modified to take a "source" with each log entry so we can tag app logs vs entrypoint logs vs. future other logs differently. This is fully backwards compatible since we just added a field and we default it to "app" scope for the zero (unset) value.
For the log streaming, we only send Info and above level logs to the stream. This currently isn't configurable. However, we still log trace level logs to the default (stderr) output. So if things are going really wrong and we need to debug further, users can still view their pod logs or container logs or whatever and grab more detailed logs. In reality for a user, any issues will be logged Info, Warn, or Error, so they'll show up in
waypoint logs
.I also made it so
waypoint logs
colors the sources differently. It looks like this: