-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
add a flag to force output to stdout #5449
Comments
Introduced by coreos/pkg#28 also see coreos/pkg#38 (comment) :-( |
I think etcd just needs to make Maybe add |
Is the intent here that a user choose one? i.e. Or is it that the user could choose many? i.e. Also, seeing as how there is conditional logic to behave differently if etcd is running under init / systemd, should there be a documented default? |
@jlamillan We can overwrite that logic by calling
|
So we can choose where to write logs. Fix etcd-io#5449.
So we can choose where to write logs. Fix etcd-io#5449.
@alban Sorry, I think I mis-read the issue:
Do you mean forwarding logs to journald and stdout at the same time? I don't think we should do that, since it's another write overhead? etcd will only log to |
@jonboulle @alban I think it is fine for us to add a flag to force writing log to stdout by default. When set it to false, we will still let the logging pkg to decide where to log. Adding a flag to support logging to multiple sinks seems to be over-kill. |
I like the idea of defaulting to stdout based entirely on the number of times I've personally had etcd drop out from under me and leave no trace of output on my terminal. |
If the setup outside of a container is the default, I would stay with journal but offer at least an option to be able to switch either entirely or in addtion to stdout. Currently I always need to test stuffs manually after errors with the containers, because they drop away and I can not read the logs anymore. |
Can we just dump journal support? It seems like it adds little value and causes confusion. |
+1, I'm reaching a similar conclusion On 14 September 2016 at 21:42, Brandon Philips [email protected]
|
Keep in mind that if you drop journal support, you lose the ability to look at the full logs when run under systemd. We depend on the syslog identifier for filtering logs since there is a race on service termination. |
Oh damn, I thought that was fixed. Alex Crawford [email protected] schrieb am Fr., 16. Sep. 2016,
|
@crawford @jonboulle @heyitsanthony Well... How should we move this forward? Breaking journald == tons of github issues without necessary logging information. |
If you are pid 1, log to stdout. If not, use the journal. |
The logging lib we use only write to journald when the ppid is 1 (pid 1's ppid is not 1): https://github.com/coreos/pkg/blob/master/capnslog/init.go#L41 So if the pid is 1, we will not log to journal now since its ppid is not1. The current behavior is what you just describe. I guess it wont make a difference? |
Was that added recently? The earlier comments in this report imply that this is not how it behaves. |
@crawford No. It added quite a while ago. |
Sounds like it isn't working properly then, otherwise I don't think this issue would have come up. Can you double check it? |
Docker added optional support to run the contained program as not PID 1 recently, so that might complicate that proposal: moby/moby#26061 |
I talked to @xiang90 offline. The plan is to leave the existing logic in place (detects the PPID of etcd to determine whether it should use the journal or stdout) and add a flag to override the behavior. Within rkt, the PPID of etcd is 1, so it logs to the journal. The rkt team would like to be able to override this so that it logs to stdout instead, allowing rkt to capture the logs. |
Can we add a flag to make etcd log force to stdout only? This is not beautiful, but it does resolve the rkt issue. |
I am fine with it. Maybe this #5449 (comment)?
|
@gyuho Can you just have a flag |
|
Why do we want etcd to log to N places? |
@xiang90 the issue is asking logging to two places but I don't have a strong opinion on it. Multi-logging can be added later so long as there's |
Yes, I know (#5449 (comment)). But I do not see why it is needed. All I can see is they want a way to force logging to stdout. |
In older versions (e.g. 2.0.10), etcd writes the output both on stdout and the journal. In newer version, it only writes to the journal:
--> output on stdout and journald (visible with journalctl)
--> output on journald only
Could we have a flag to force output to stdout as well?
Initially reported in #4993
See also rkt/rkt#2417 (comment)
/cc @jonboulle @iaguis
The text was updated successfully, but these errors were encountered: