summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-01-30 11:22:55 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-01-30 11:22:55 +0000
commitc23a70a68a1d8661c8928c8d08a24339fa323aac (patch)
tree9246422b98b70bd4ad53abab62d74d488edb06f7
parent7f3886e54be0f3b7f8c4912c192a6fa4f74cadf7 (diff)
downloadrsyslog-c23a70a68a1d8661c8928c8d08a24339fa323aac.tar.gz
rsyslog-c23a70a68a1d8661c8928c8d08a24339fa323aac.tar.xz
rsyslog-c23a70a68a1d8661c8928c8d08a24339fa323aac.zip
added -e option to turn off message suppression
-rw-r--r--NEWS2
-rw-r--r--rsyslogd.812
-rw-r--r--syslogd.c13
3 files changed, 23 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index 144bd0a3..1791ba08 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,8 @@ Version 1.13.1 (RGer), 2007-02-xx
left-over from early testing).
- fixed a bug in makefile which caused DB-support to be disabled when
NETZIP support was enabled
+- added the -e option to allow transmission of every message to remote
+ hosts (effectively turns off duplicate message suppression)
---------------------------------------------------------------------------
Version 1.13.0 (RGer), 2006-12-19
- added '$' as ToPos proptery replacer specifier - means "up to the
diff --git a/rsyslogd.8 b/rsyslogd.8
index 8273dd01..3a214b80 100644
--- a/rsyslogd.8
+++ b/rsyslogd.8
@@ -1,7 +1,7 @@
.\" Copyright 2004-2005 Rainer Gerhards and Adiscon for the rsyslog modifications
.\" May be distributed under the GNU General Public License
.\"
-.TH RSYSLOGD 8 "04 October 2006" "Version 1.12.3 (unstable)" "Linux System Administration"
+.TH RSYSLOGD 8 "01 February 2007" "Version 1.13.1 (unstable)" "Linux System Administration"
.SH NAME
rsyslogd \- reliable and extended syslogd
.SH SYNOPSIS
@@ -10,6 +10,7 @@ rsyslogd \- reliable and extended syslogd
.I socket
]
.RB [ " \-d " ]
+.RB [ " \-e " ]
.RB [ " \-f "
.I config file
]
@@ -28,10 +29,10 @@ rsyslogd \- reliable and extended syslogd
.RB [ " \-p"
.IB socket
]
+.br
.RB [ " \-r "
.I port
]
-.br
.RB [ " \-s "
.I domainlist
]
@@ -111,6 +112,13 @@ to set itself in the background, but opposite to that stay in the
foreground and write much debug information on the current tty. See the
DEBUGGING section for more information.
.TP
+.B "\-e"
+Turns on delivery of every message (e like "every"). Without this
+option, rsyslog tries to suppress what seems to be duplicate messages.
+This is done by stock syslogd and rsyslogd mimics this behaviour for
+best compatibility. In many cases, however, one would like to see all
+messages on remote hosts. In this case, turn on the -e option.
+.TP
.BI "\-f " "config file"
Specify an alternative configuration file instead of
.IR /etc/rsyslog.conf ","
diff --git a/syslogd.c b/syslogd.c
index a0d8f30b..f8aecd1d 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -816,6 +816,10 @@ static struct code FacNames[] = {
};
static int Debug; /* debug flag - read-only after startup */
+static int logEveryMsg = 0;/* no repeat message processing - read-only after startup
+ * 0 - suppress duplicate messages
+ * 1 - do NOT suppress duplicate messages
+ */
static char LocalHostName[MAXHOSTNAMELEN+1];/* our hostname - read-only after startup */
static char *LocalDomain; /* our local domain name - read-only after startup */
static int InetInuse = 0; /* non-zero if INET sockets are being used
@@ -4364,7 +4368,8 @@ static void processMsg(struct msg *pMsg)
/* suppress duplicate lines to this file
*/
- if ((pMsg->msgFlags & MARK) == 0 && getMSGLen(pMsg) == getMSGLen(f->f_pMsg) &&
+ if ((logEveryMsg == 0) &&
+ (pMsg->msgFlags & MARK) == 0 && getMSGLen(pMsg) == getMSGLen(f->f_pMsg) &&
!strcmp(getMSG(pMsg), getMSG(f->f_pMsg)) &&
!strcmp(getHOSTNAME(pMsg), getHOSTNAME(f->f_pMsg))) {
f->f_prevcount++;
@@ -7776,6 +7781,7 @@ static void initMySQL(register struct filed *f)
if (checkDBErrorState(f))
return;
+ /* TODO: in rare cases, NULL may be returned below! */
mysql_init(&f->f_hmysql);
do {
/* Connect to database */
@@ -8395,7 +8401,7 @@ int main(int argc, char **argv)
funix[i] = -1;
}
- while ((ch = getopt(argc, argv, "a:dhi:f:l:m:nop:r:s:t:u:vw")) != EOF)
+ while ((ch = getopt(argc, argv, "a:dehi:f:l:m:nop:r:s:t:u:vw")) != EOF)
switch((char)ch) {
case 'a':
if (nfunix < MAXFUNIX)
@@ -8413,6 +8419,9 @@ int main(int argc, char **argv)
case 'd': /* debug */
Debug = 1;
break;
+ case 'e': /* log every message (no repeat message supression) */
+ logEveryMsg = 1;
+ break;
case 'f': /* configuration file */
ConfFile = optarg;
break;