As you know, there is syslog library in C. It is supposed to keep logs under /var/log/ directory. I’ve been trying to find where the user logs get stored in Manjaro but have been unsuccessful finding them so far. I tried using journalctl but couldn’t find anything there either.
I am inspecting the files under /var/log/journal with grep. I also used journalctl command to see if there are any logs. But I wasn’t able to find anything that was logged by my program.
journald uses a binary format, so you should use journalctl. You can run journalctl -f, which will continuously emit log messages as they come in, and then you can start your program to see if they appear there.
I tried yours and it indeed worked. Here is my program, can you tell me what’s wrong with it?
#include <syslog.h>
int main()
setlogmask (LOG_UPTO (LOG_WARNING));
openlog ("exampleprog", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);
syslog (LOG_NOTICE, "Program started by User");
syslog (LOG_INFO, "A tree falls in a forest");
closelog ();
return 0;
}