summaryrefslogtreecommitdiffstats
path: root/runtime/msg.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-03-05 07:56:57 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2010-03-05 07:56:57 +0100
commitb3c8528b5087289c9b1f357f98f890190a5621a0 (patch)
treead0cefb7902ab3de9b2d2fb72be2bcbb8ddadcbf /runtime/msg.c
parent5402ba982fd8c9bb9ce7fab43ddabaa174ab0794 (diff)
downloadrsyslog-b3c8528b5087289c9b1f357f98f890190a5621a0.tar.gz
rsyslog-b3c8528b5087289c9b1f357f98f890190a5621a0.tar.xz
rsyslog-b3c8528b5087289c9b1f357f98f890190a5621a0.zip
added new property replacer option "date-rfc3164-buggyday"
primarily to ease migration from syslog-ng. See property replacer doc for details.
Diffstat (limited to 'runtime/msg.c')
-rw-r--r--runtime/msg.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/runtime/msg.c b/runtime/msg.c
index 629c6f24..ab0e45ba 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -1272,10 +1272,12 @@ static inline char *getTimeReported(msg_t *pM, enum tplFormatTypes eFmt)
switch(eFmt) {
case tplFmtDefault:
case tplFmtRFC3164Date:
+ case tplFmtRFC3164BuggyDate:
MsgLock(pM);
if(pM->pszTIMESTAMP3164 == NULL) {
pM->pszTIMESTAMP3164 = pM->pszTimestamp3164;
- datetime.formatTimestamp3164(&pM->tTIMESTAMP, pM->pszTIMESTAMP3164);
+ datetime.formatTimestamp3164(&pM->tTIMESTAMP, pM->pszTIMESTAMP3164,
+ (eFmt == tplFmtRFC3164BuggyDate));
}
MsgUnlock(pM);
return(pM->pszTIMESTAMP3164);
@@ -1338,7 +1340,7 @@ static inline char *getTimeGenerated(msg_t *pM, enum tplFormatTypes eFmt)
MsgUnlock(pM);
return "";
}
- datetime.formatTimestamp3164(&pM->tRcvdAt, pM->pszRcvdAt3164);
+ datetime.formatTimestamp3164(&pM->tRcvdAt, pM->pszRcvdAt3164, 0);
}
MsgUnlock(pM);
return(pM->pszRcvdAt3164);
@@ -1365,13 +1367,15 @@ static inline char *getTimeGenerated(msg_t *pM, enum tplFormatTypes eFmt)
MsgUnlock(pM);
return(pM->pszRcvdAt_PgSQL);
case tplFmtRFC3164Date:
+ case tplFmtRFC3164BuggyDate:
MsgLock(pM);
if(pM->pszRcvdAt3164 == NULL) {
if((pM->pszRcvdAt3164 = MALLOC(16)) == NULL) {
MsgUnlock(pM);
return "";
}
- datetime.formatTimestamp3164(&pM->tRcvdAt, pM->pszRcvdAt3164);
+ datetime.formatTimestamp3164(&pM->tRcvdAt, pM->pszRcvdAt3164,
+ (eFmt == tplFmtRFC3164BuggyDate));
}
MsgUnlock(pM);
return(pM->pszRcvdAt3164);