Skip to content
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

Merged
merged 8 commits into from
Nov 30, 2020

Conversation

mitchellh
Copy link
Contributor

@mitchellh mitchellh commented Nov 29, 2020

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:

image

@mitchellh mitchellh added this to the 0.2.0 milestone Nov 29, 2020
@github-actions github-actions bot added the core label Nov 29, 2020
Copy link
Member

@briancain briancain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 looks good to me! I like the ux and color updates 🎨

Copy link
Contributor

@evanphx evanphx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment about atomic pointer alignment.

internal/ceb/ceb.go Outdated Show resolved Hide resolved
@@ -66,21 +66,20 @@ type CEB struct {
// commands will stop the old command first. Values sent here are coalesced
// in case many changes are sent in a row.
childCmdCh chan<- *exec.Cmd
childInit uint32
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just wasn't used so I deleted it.

@mitchellh mitchellh merged commit 59247aa into main Nov 30, 2020
@mitchellh mitchellh deleted the f-ceb-log branch November 30, 2020 21:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants