From 956ff6de3df00beb0399a464f53936cf29826631 Mon Sep 17 00:00:00 2001 From: Susant Sahani Date: Mon, 13 May 2024 20:10:02 +0530 Subject: [PATCH] journal: Add debug log for current cursor --- src/netlog/netlog-manager.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/netlog/netlog-manager.c b/src/netlog/netlog-manager.c index 639a951..1cffe37 100644 --- a/src/netlog/netlog-manager.c +++ b/src/netlog/netlog-manager.c @@ -84,12 +84,17 @@ static int manager_read_journal_input(Manager *m) { const void *data; usec_t realtime; size_t length; + char *cursor; int r; assert(m); assert(m->journal); - log_debug("Reading from journal cursor=%s", m->last_cursor); + r = sd_journal_get_cursor(m->journal, &cursor); + if (r < 0) + return log_error_errno(r, "Failed to get cursor: %m"); + + log_debug("Reading from journal cursor=%s", cursor); JOURNAL_FOREACH_DATA_RETVAL(m->journal, data, length, r) {