summaryrefslogtreecommitdiffstats
path: root/syslogd.c
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 /syslogd.c
parent7f3886e54be0f3b7f8c4912c192a6fa4f74cadf7 (diff)
downloadrsyslog-c23a70a68a1d8661c8928c8d08a24339fa323aac.tar.gz
rsyslog-c23a70a68a1d8661c8928c8d08a24339fa323aac.tar.xz
rsyslog-c23a70a68a1d8661c8928c8d08a24339fa323aac.zip
added -e option to turn off message suppression
Diffstat (limited to 'syslogd.c')
-rw-r--r--syslogd.c13
1 files changed, 11 insertions, 2 deletions
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;