diff --git a/src/sentrypeer.c b/src/sentrypeer.c index 63040dc..fc6d10d 100644 --- a/src/sentrypeer.c +++ b/src/sentrypeer.c @@ -3,6 +3,8 @@ #include #include +#include // for syslog() + // Produced by autoconf and cmake (manually by me) #include "config.h" @@ -14,16 +16,21 @@ int main(int argc, char **argv) { struct sentrypeer_config config; + openlog("sentrypeer", LOG_PID, LOG_USER); + if (process_cli(&config, argc, argv) != EXIT_SUCCESS) { + syslog(LOG_ERR, "Could not parse options\n"); exit(EXIT_FAILURE); } if (config.debug_mode || config.verbose_mode) { fprintf(stderr, "Starting %s...\n", PACKAGE_NAME); + syslog(LOG_ERR, "Starting %s...\n", PACKAGE_NAME); } if (sip_daemon_init(&config) == EXIT_FAILURE) { fprintf(stderr, "Failed to start SIP server..\n"); + syslog(LOG_ERR, "Failed to start SIP server..\n"); exit(EXIT_FAILURE); }