Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

log to stdout xor stderr, depending on severity #58

Merged
merged 1 commit into from
Nov 16, 2017
Merged

log to stdout xor stderr, depending on severity #58

merged 1 commit into from
Nov 16, 2017

Conversation

krancour
Copy link
Contributor

Fixes #25

@bingosummer can you please verify that the source in this branch produces the desired results when running the broker in Cloud Foundry?

@krancour krancour added this to the v0.4.0 milestone Nov 15, 2017
@krancour krancour self-assigned this Nov 15, 2017
Copy link
Contributor

@arschles arschles left a comment

Choose a reason for hiding this comment

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

Thanks for this @krancour

I'm going to leave this unmerged until @bingosummer verifies it works properly on CF

Gopkg.toml Outdated
@@ -29,6 +29,8 @@

[[constraint]]
name = "github.com/Sirupsen/logrus"
source = "github.com/krancour/logrus"
branch = "split-streams"
Copy link
Contributor

Choose a reason for hiding this comment

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

gonna leave this on your branch if/until logrus fixes? if so, can you put some doc here with a link to the issue/PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Upstream PR isn't open just yet. I did leave a comment about this in broker.go. I can add one here as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Commented in both places.

@krancour
Copy link
Contributor Author

Ok... I'm no CF expert, but I decided to dip my toes in that pool and try this myself. I added two new debug statements to cmd/broker/broker.go to test this:

func main() {
	log.Info("This is NOT an error!")
	log.Error("This IS an error!")
	// ... existing code ...
}

And the results in the logs are this:

$ cf logs asb --recent
...
2017-11-16T13:55:41.95-0500 [APP/PROC/WEB/0] ERR time="2017-11-16T18:55:41Z" level=error msg="This IS an error!"
   2017-11-16T13:55:41.95-0500 [APP/PROC/WEB/0] OUT time="2017-11-16T18:55:41Z" level=info msg="This is NOT an error!"

I'm satisfied that this change is working as expected vis-a-vis CF. Merging.

@krancour krancour merged commit ae3cdc3 into Azure:master Nov 16, 2017
@krancour krancour deleted the logging-fix branch November 16, 2017 19:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants