Hello to everyone! I have a question about syslog.
I want put the messages of log in a particular file
but really i don't know how to do that or i don't get the results
that I want.
I do this:
And in 50-default.conf I add this line
But the file var.log is empty after i ran the program (Obviously I do a rsyslogd restart before run the program).
What is wrong with this?
Bye!
I want put the messages of log in a particular file
but really i don't know how to do that or i don't get the results
that I want.
I do this:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <syslog.h>
int main (void)
{
openlog("Test",LOG_PID,LOG_USER);
syslog(LOG_INFO,"LOG!!");
closelog();
}
Code:
if $programname=='Test' then /home/me/var.log
What is wrong with this?
Bye!