Cannot see "file,line,func" fields in the journal
0
votes
1
answer
12
views
I am trying to use
sd_journal_print_with_location()
function.
#include
int main() {
sd_journal_print_with_location(LOG_INFO, "CODE_FILE=tst_file.c", "CODE_LINE=123", "main", "message");
return 0;
}
And then execute:
$ gcc -o tst_file tst_file.c -lsystemd
$ ./tst_file
$ journalctl --identifier=tst_file
Dec 11 12:29:17 MYBOX tst_file: message
So the question is: Where are file
, line
, and func
fields? Why cannot I see them with the journalctl
?
What am I doing wrong?
Asked by White Owl
(5267 rep)
Dec 11, 2024, 05:34 PM
Last activity: Dec 11, 2024, 05:49 PM
Last activity: Dec 11, 2024, 05:49 PM