I'm starting logstash using a custom init script. It runs logstash using the following command:
Every time the process is started, it is printing some data out to stdout instead of the logfile. Specifically:
It seems to me that, if the logfile option is specified, all output should be going to the log and not to stdout (unless the stdout output is in use, of course).
This is rather a feature. I can explain!
If you specify the -l or --log flag AND stdout is a tty, logstash will temporarily log startup messages to the terminal:
https://github.com/logstash/logstash/blob/v1.2.1/lib/logstash/agent.rb#L77-L83
After startup (plugin configuration, etc), stdout will no longer be logged to if the above conditions were met (stdout is a tty AND l/-log flag given)
https://github.com/logstash/logstash/blob/v1.2.1/lib/logstash/agent.rb#L129
The purpose of this is to help users diagnose failures in the common case. Such common case includes users reporting they see no errors on startup because they forgot to check the log - we all forget sometimes!
If you do not wish this to occur, you can simply redirect stdout to /dev/null and logstash will not output anything to your terminal.
Please let me know if you have any other questions about this feature!
It would be helpful if this feature was documented somewhere. I was looking for the better part of a week to try and figure out why it insisted on printing to stdout even when I was specifying a logfile. I also asked multiple times in IRC and no one was able to tell me why it was printing to stdout.
Might be worth simply logging an indication of why users would see this, so you'd see it yourself with the explanation and it wouldn't be confusing?