commit a89852fa636d1f79de462e5196440cc6b387de30
Author: Sergey Poznyakoff <gray@gnu.org>
Date:   Wed Jun 26 15:55:05 2024 +0300
Forwarded: not-needed

    Configurable syslog tag
    
    * src/extern.h (syslog_tag): New extern.
    * src/pound.c (syslog_tag): New variable.
    (main): Use syslog_tag, if set, and progname otherwise.
    * src/config.c: New global statement: LogTag.
    * NEWS: Document changes.
    * doc/pound.8: Likewise.
    * doc/pound.texi: Likewise.
    * configure.ac: Version 4.12.90

diff --git a/NEWS b/NEWS
index cec3456..49e420c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-Pound -- history of user-visible changes. 2024-04-26
+Pound -- history of user-visible changes. 2024-06-26
 See the end of file for copying conditions.
 
 Pound is a continuation of the software originally developed by
@@ -6,6 +6,14 @@ Robert Segall at Apsis GmbH, which was officially discontinued
 on 2022-09-19.  See the README file for details.
 
 Please send pound bug reports to <gray@gnu.org>
+
+Version 4.12.90 (git)
+
+* New configuration statement: LogTag
+
+Sets a string to tag syslog messages with.  By default, same as the
+name used to start the program.
+
 
 Version 4.12, 2024-04-26
 
diff --git a/configure.ac b/configure.ac
index e7095cf..dded9c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with pound.  If not, see <http://www.gnu.org/licenses/>.
 AC_PREREQ([2.71])
-AC_INIT([pound],[4.12],[gray@gnu.org],
+AC_INIT([pound],[4.12.90],[gray@gnu.org],
 	[pound],[https://github.com/graygnuorg/pound])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_SRCDIR([src/pound.c])
diff --git a/doc/pound.8 b/doc/pound.8
index 3dc0522..acda940 100644
--- a/doc/pound.8
+++ b/doc/pound.8
@@ -14,7 +14,7 @@
 .\"
 .\" You should have received a copy of the GNU General Public License
 .\" along with pound.  If not, see <http://www.gnu.org/licenses/>.
-.TH POUND 8 "June 6, 2024" "pound" "System Manager's Manual"
+.TH POUND 8 "June 26, 2024" "pound" "System Manager's Manual"
 .SH NAME
 pound \- HTTP/HTTPS reverse-proxy and load-balancer
 .SH SYNOPSIS
@@ -520,6 +520,11 @@ directive.  See section
 .BR "REQUEST LOGGING" ,
 for a detailed discussion.
 .TP
+\fBLogTag\fR "\fIstring\fR"
+Sets the string to tag log messages with.  This is used when log
+output goes to syslog.  Default is the name with which \fBpound\fR
+was started.
+.TP
 \fBForwardedHeader\fR \fIname\fR
 Defines the name of the HTTP header that carries the list of proxies
 the request has passed through.  It is used to report the originator
diff --git a/doc/pound.texi b/doc/pound.texi
index 9310a7f..b9c85f6 100644
--- a/doc/pound.texi
+++ b/doc/pound.texi
@@ -2263,6 +2263,20 @@ current working directory using the @option{-W no-include-dir} option
 
 @node Logging configuration
 @section Logging configuration
+@deffn {Global directive} LogFacility @var{name}
+@deffnx {Global directive} LogFacility -
+Sets the @command{syslog} facility to use for logging.  Allowed names
+are: @samp{auth}, @samp{authpriv}, @samp{cron}, @samp{daemon}, @samp{ftp},
+@samp{kern}, @samp{lpr}. @samp{mail}, @samp{news},
+@samp{user}. @samp{uucp}, and @samp{local0} through @samp{local7}.
+
+The second form configures @dfn{default log destination}.  If
+@command{pound} runs in foreground, log messages with priority
+@code{LOG_DEBUG} and @code{LOG_INFO} go to stdout, and messages with
+the remaining priorities are printed to stderr.  If @command{pound}
+runs as a daemon, log messages go to the syslog facility @samp{daemon}.
+@end deffn
+
 @deffn {Global directive} LogFormat "@var{name}" "@var{format_def}"
 Define request logging format.  @var{name} is a string uniquely
 identifying this format, and @var{format_def} is the format string
@@ -2282,6 +2296,12 @@ number (0 through 5).
 @xref{Logging}, for a detailed description of HTTP request logging.
 @end deffn
 
+@deffn {Global directive} LogTag "@var{string}"
+Sets the string to tag syslog messages with.  By default, it is the
+name of the program (more precisely, the name which was used to start
+it).
+@end deffn
+
 @deffn {Global directive} ForwardedHeader "@var{name}"
 Defines the name of the HTTP header that carries the list of proxies
 the request has passed through.  Default value is
diff --git a/src/config.c b/src/config.c
index 70f5784..7561f30 100644
--- a/src/config.c
+++ b/src/config.c
@@ -5726,6 +5726,11 @@ static PARSER_TABLE top_level_parsetab[] = {
     .name = "LogFormat",
     .parser = parse_log_format
   },
+  {
+    .name = "LogTag",
+    .parser = assign_string,
+    .data = &syslog_tag
+  },
   {
     .name = "Alive",
     .parser = assign_timeout,
diff --git a/src/extern.h b/src/extern.h
index 05a1750..58edc7f 100644
--- a/src/extern.h
+++ b/src/extern.h
@@ -3,7 +3,7 @@
  */
 
 extern char const *progname;          /* program name */
-
+extern char *syslog_tag;        /* syslog tag */
 extern char *user,		/* user to run as */
   *group,			/* group to run as */
   *root_jail,			/* directory to chroot to */
diff --git a/src/pound.c b/src/pound.c
index adb247d..7df7987 100644
--- a/src/pound.c
+++ b/src/pound.c
@@ -50,6 +50,9 @@ regex_t HEADER,			/* Allowed header */
 char *forwarded_header;         /* "forwarded" header name */
 ACL *trusted_ips;               /* Trusted IP addresses */
 
+char *syslog_tag;               /* Tag to mark syslog messages with.
+				   If NULL, progname will be used. */
+
 #ifndef  SOL_TCP
 /* for systems without the definition */
 int SOL_TCP;
@@ -1000,7 +1003,8 @@ main (const int argc, char **argv)
   config_parse (argc, argv);
 
   if (log_facility != -1)
-    openlog (progname, LOG_CONS | LOG_NDELAY | LOG_PID, log_facility);
+    openlog (syslog_tag ? syslog_tag : progname,
+	     LOG_CONS | LOG_NDELAY | LOG_PID, log_facility);
 
   /* set uid if necessary */
   if (user)
