Logstash printing to stdout even with logfile specified

Description

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).

Activity

Show:
Jordan Sissel
September 14, 2013, 6:01 AM
Edited

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.

Jordan Sissel
September 14, 2013, 6:02 AM

Please let me know if you have any other questions about this feature!

Ryan DeShone
September 25, 2013, 5:00 PM

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.

Jordan Sissel
July 5, 2014, 9:26 PM

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?

Won't Fix

Assignee

Logstash Developers

Reporter

Ryan DeShone

Labels

Affects versions

Configure