Combining tail && journalctl


I'm tailing logs of my own app and postgres.

tail -f /tmp/myapp.log /var/log/postgresql/postgresql.main.log

I need to include pgpool's logs. It used to be syslog but now it is in journalctl.

Is there a way to tie tail -f && journalctl -f together?

Best Answer

  • You could use:

    journalctl -u service-name -f

    -f, --follow

    Show only the most recent journal entries, and continuously print new entries as they are appended to the journal.

    Here I've added "service-name" to distinguish this answer from others; you substitute the actual service name instead of the text service-name.

  • Related Question