]> err.no Git - varnish/commitdiff
Use instance name (-n) or "varnishd" for syslog identifier.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 22 Jun 2008 12:15:11 +0000 (12:15 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 22 Jun 2008 12:15:11 +0000 (12:15 +0000)
Log under facility LOCAL0

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2772 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/varnishd.c

index e0d14ae0b3c2b537f03ab1926f7976c91a65e0b8..0780bf38227f374196108633f4a08b8606e1709d 100644 (file)
@@ -45,6 +45,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <syslog.h>
 #include <time.h>
 #include <unistd.h>
 
@@ -506,6 +507,11 @@ main(int argc, char *argv[])
                exit(1);
        }
 
+       if (n_arg != NULL) 
+               openlog(n_arg, LOG_PID, LOG_LOCAL0);
+       else
+               openlog("varnishd", LOG_PID, LOG_LOCAL0);
+
        if (mkdir(dirname, 0755) < 0 && errno != EEXIST) {
                fprintf(stderr, "Cannot create working directory '%s': %s\n",
                    dirname, strerror(errno));