-
Notifications
You must be signed in to change notification settings - Fork 19
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
logging: only check stderr for protocol upgrading #121
Conversation
/cc @lunaryorn This is the result of a recent conversation I had with systemd folks. There is a summary of that in coreos/go-systemd#410 (comment). In short, my understanding of "native protocol upgrading" was wrong: in reality the systemd approach assumes that all logging happens on stderr, so it shouldn't be concerned with stdout. Instead, the stdout/stderr checks are two separate lower level primitives which can be used independently. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks. I agree that changing the connected_to_journal
function is a good idea, but I'm less sure about these helpers; do we really need those? Would someone really like to check stdout so frequently that they need an explicit helper? Shouldn't we just expose JournalStream
directly, so everyone can check whatever stream they like if they really have to?
Yes, I don't think there is going to be much usage for the stdout helper, it is mostly there for symmetry with stderr.
Overall, it sounds like I can just only change Speaking of public interfaces, do you have a need for public |
@lucab Yes, I'd just change |
This changes `connected_to_journal()` behavior to only check stderr against `$JOURNAL_STREAM` for protocol upgrading. Protocol upgrading assumes that all the logging happens on stderr. For that purpose, it is not relevant whether stdout is connected to journal.
c51fdd8
to
f841cf9
Compare
That's how systemd wants us to do this, see lucab/libsystemd-rs#121
That's how systemd wants us to do this, see lucab/libsystemd-rs#121
This changes
connected_to_journal()
behavior to only check stderragainst
$JOURNAL_STREAM
for protocol upgrading.Protocol upgrading assumes that all the logging happens on stderr.
For that purpose, it is not relevant whether stdout is connected
to journal.