Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // gcc giuspexample.c -o giuspexample
- #include <syslog.h>
- int main()
- {
- setlogmask(LOG_UPTO (LOG_NOTICE));
- openlog("atm", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL0);
- syslog(LOG_NOTICE, "Program started by User %d", getuid ());
- syslog(LOG_INFO, "A tree falls in a forest");
- closelog();
- return 0;
- }
- echo "local0.* /var/log/mylog" >> /etc/syslog.conf
- sudo /etc/init.d/syslog restart
- # Log QSD Centro generated log messages to file
- if $programname == 'centro' then /var/log/centro.log
- # Uncomment the following to stop logging anything that matches the last rule.
- & ~
- sudo rm -f /var/log/centro.log
- sudo service rsyslog restart
- // gcc centro.c -o centro
- #include <stdio.h>
- #include <syslog.h>
- int main(int argc, char *argv[])
- {
- openlog(NULL, 0, LOG_USER);
- syslog(LOG_INFO, "MORTACCI TUA!!!");
- closelog();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement