Logstash Logging setting to output rubydebug info for running service

I'm using the default settings. When I run LS as a service, the logging in the plain.log file doesn't have any of the rubydebug output.

When I run it with the -f flag, I see all the output normally.

What setting file do I need to modify to show all the logging output? I looked at log4j2 but couldn't determine what needed to be modified. I think 'info' is the default logging level?

Setting the 'debug' level in logstash.yml is too verbose compared to the regular output when I run -f. I just want the console output from rubydebug.

rubydebug output does not go through log4j2. You could use a file output with a rubydebug codec.

But it outputs to console?

If you use

output { stdout { codec => rubydebug } }

then it outputs to the console. But you can use

output { file { codec => rubydebug path => "/tmp/foo.txt" } }

I don't like that, because then I would have to modify the way it works when i do the -f param, where the logging is happening in a single terminal.

If you want to capture stdout of a service then that is a question about whatever service manager you use, not about logstash.

If you are using systemd then this might help.

I'm just running logstash as a service and using tail -f /etc/logstash/logs/logstash-plain.log

Which service manager are you using?

I'm using ubuntu, so systemd i guess.

OK, so read the post that I linked to.

That was a lot of text to read through, but the gist is to do this:

sudo journalctl -f -u logstash

is there no way to make log4j2 capture console logs?

Last time I used logstash (1.5) I don't think this wasn't a problem.

There is no way to route data from a stdout output to log4j2. It writes directly to stdout.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.