11

I need to see all postgresql logs. I try:

$ journalctl -f -u postgresql.service SYSLOG_IDENTIFIER=postgres
-- Logs begin at Ср 2013-03-06 00:57:40 KRAT. --
авг 11 23:41:07 nuzzflonk postgres[2432]: LOG:  database system was interrupted; last known up at 2013-08-11 20:12:28 KRAT
авг 11 23:41:07 nuzzflonk postgres[2432]: LOG:  database system was not properly shut down; automatic recovery in progress
авг 11 23:41:07 nuzzflonk postgres[2432]: LOG:  record with zero length at 5/DACF208
авг 11 23:41:07 nuzzflonk postgres[2432]: LOG:  redo is not required
авг 11 23:41:07 nuzzflonk postgres[2432]: LOG:  autovacuum launcher started
авг 11 23:41:07 nuzzflonk postgres[2432]: LOG:  database system is ready to accept connections
-- Reboot --
авг 19 20:23:22 nuzzflonk postgres[2361]: FATAL:  the database system is starting up
авг 19 20:23:22 nuzzflonk postgres[2361]: LOG:  database system was shut down at 2013-08-19 20:21:25 KRAT
авг 19 20:23:22 nuzzflonk postgres[2361]: LOG:  autovacuum launcher started
авг 19 20:23:22 nuzzflonk postgres[2361]: LOG:  database system is ready to accept connections

But:

$ journalctl -f SYSLOG_IDENTIFIER=postgres 
-- Logs begin at Ср 2013-03-06 00:57:40 KRAT. --
авг 24 10:50:07 nuzzflonk postgres[2361]: LOG:  unexpected EOF on client connection with an open transaction
авг 24 11:10:07 nuzzflonk postgres[2361]: LOG:  unexpected EOF on client connection with an open transaction
авг 24 11:20:07 nuzzflonk postgres[2361]: LOG:  unexpected EOF on client connection with an open transaction
авг 24 11:30:07 nuzzflonk postgres[2361]: LOG:  unexpected EOF on client connection with an open transaction
авг 24 11:40:07 nuzzflonk postgres[2361]: LOG:  unexpected EOF on client connection with an open transaction
авг 24 11:50:08 nuzzflonk postgres[2361]: LOG:  unexpected EOF on client connection with an open transaction
авг 24 12:00:07 nuzzflonk postgres[2361]: LOG:  unexpected EOF on client connection with an open transaction
авг 24 12:30:07 nuzzflonk postgres[2361]: LOG:  unexpected EOF on client connection with an open transaction
авг 24 12:40:07 nuzzflonk postgres[2361]: LOG:  unexpected EOF on client connection with an open transaction
авг 24 12:50:07 nuzzflonk postgres[2361]: LOG:  unexpected EOF on client connection with an open transaction

How to combine two journals?

UPD: Solved. $ journalctl -f SYSLOG_IDENTIFIER=postgres show all journals.

3
  • 1
    If you have solved your own problem, please feel free to post it as an Answer below. Aug 24, 2013 at 16:46
  • 1
    UPD: Solved. $ journalctl -f SYSLOG_IDENTIFIER=postgres show all journals.
    – Vladislav
    Aug 26, 2013 at 1:45
  • @Vladislav: How did you manage to create 2 or more different journals?
    – woodz
    Dec 5, 2022 at 11:58

1 Answer 1

19

To combine the output of multiple journals you just need to add them to your command using the -u option as follows:

journalctl -u nginx.service -u mysql.service -f

No need to use SYSLOG_IDENTIFIER as that will likely not be what you want in most cases.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .