Tried to debug it a bit more, with the attached test program. It has printed the first message from each 4-hour chunk of messages (mentioned as "<message 1>" in the original report), but nothing else -- though there are others that match ("<message 2>" and so on), including the ones written by the same process as those first-in-group messages. This behaviour is different from what journalctl does, but also erroneous. In both cases (with journalctl and with this test program), it goes back too far, to the same record.
For another OBJECT_ID (for which journalctl works fine, and with less repetitive messages), the test program has printed the logs seemingly correctly, without skipping anything.
#include <systemd/sd-journal.h> #include <stdio.h> int read_journal (sd_journal *j) { const char *d; size_t l; if (sd_journal_add_match(j, "OBJECT_ID=50482", 0) < 0) { perror("Failed to add match"); return 1; } SD_JOURNAL_FOREACH_BACKWARDS(j) { puts("--"); SD_JOURNAL_FOREACH_DATA(j, d, l) { printf("%.*s\n", (int) l, d); } } return 0; } int main () { int ret; sd_journal *j; if (sd_journal_open(&j, 0) < 0) { perror("Failed to open journal"); return 1; } ret = read_journal(j); sd_journal_close(j); return ret; }
_______________________________________________ Pkg-systemd-maintainers mailing list Pkg-systemd-maintainers@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-systemd-maintainers