diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2005-11-23 17:44:58 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2005-11-23 17:44:58 +0000 |
commit | 193a639b2481eba4a6b881a53ac3ff6c5faab410 (patch) | |
tree | fa369270fe3560fb9005e61e0d4013f1b85eef23 | |
parent | 46be94a0ae4af704b1a1b04007724a28d1b37fbb (diff) | |
download | rsyslog-193a639b2481eba4a6b881a53ac3ff6c5faab410.tar.gz rsyslog-193a639b2481eba4a6b881a53ac3ff6c5faab410.tar.xz rsyslog-193a639b2481eba4a6b881a53ac3ff6c5faab410.zip |
fixed a bug in RFC3339 timestamp generation; added support for 3339
timestamps in internally-generated messages
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | syslogd.c | 8 |
2 files changed, 6 insertions, 6 deletions
@@ -1,5 +1,9 @@ ---------------------------------------------------------------------------
Version 1.12.2 (RGer), 2005-11-??
+- fixed a bug in the RFC 3339 date formater. An extra space was added
+ after the actual timestamp
+- added support for providing high-precision RFC3339 timestamps for
+ (rsyslogd-)internally-generated messages
---------------------------------------------------------------------------
Version 1.12.1 (RGer), 2005-11-23
- made multithreading work with BSD. Some signal-handling needed to be
@@ -1838,7 +1838,7 @@ static int formatTimestamp3339(struct syslogTime *ts, char* pBuf, size_t iLenBuf char szFmtStr[64]; /* be careful: there is ONE actual %d in the format string below ;) */ snprintf(szFmtStr, sizeof(szFmtStr), - "%%04d-%%02d-%%02dT%%02d:%%02d:%%02d.%%0%dd%%c%%02d:%%02d ", + "%%04d-%%02d-%%02dT%%02d:%%02d:%%02d.%%0%dd%%c%%02d:%%02d", ts->secfracPrecision); iRet = snprintf(pBuf, iLenBuf, szFmtStr, ts->year, ts->month, ts->day, ts->hour, ts->minute, ts->second, ts->secfrac, @@ -1846,7 +1846,7 @@ static int formatTimestamp3339(struct syslogTime *ts, char* pBuf, size_t iLenBuf } else iRet = snprintf(pBuf, iLenBuf, - "%4.4d-%2.2d-%2.2dT%2.2d:%2.2d:%2.2d%c%2.2d:%2.2d ", + "%4.4d-%2.2d-%2.2dT%2.2d:%2.2d:%2.2d%c%2.2d:%2.2d", ts->year, ts->month, ts->day, ts->hour, ts->minute, ts->second, ts->OffsetMode, ts->OffsetHour, ts->OffsetMinute); @@ -3730,10 +3730,6 @@ void logmsg(int pri, struct msg *pMsg, int flags) (void) time(&now); if (flags & ADDDATE) { getCurrTime(&(pMsg->tTIMESTAMP)); /* use the current time! */ - /* but modify it to be an RFC 3164 time... */ - pMsg->tTIMESTAMP.timeType = 1; - pMsg->tTIMESTAMP.secfracPrecision = 0; - pMsg->tTIMESTAMP.secfrac = 0; } /* parse HOSTNAME - but only if this is network-received! |