*** sysklogd-1.3/syslogd.c Thu Jan 29 22:49:19 1998 --- sysklogd-1.3-22-patched/syslogd.c Thu Feb 12 18:22:07 1998 *************** *** 337,342 **** --- 337,353 ---- * * Mon Jan 12 19:50:58 CET 1998: Martin Schulze * Modified debug output concerning remote receiption. + * + * Thu Feb 12 18:00:00 CET 1998: Sascha Ziemann + * Added a FULL_TIME definition to log the year. + * Disadvantages: + * - Incompatible with scripts which use the old date. + * - Uses cpu time to calculate the date. + * - Drops the original date. So the logged time is not the + * time the event occures but the time the message arrives + * in syslog. + * Advantage: + * - Full time information in the logs. */ *************** *** 348,353 **** --- 359,367 ---- #define CONT_LINE 1 /* Allow continuation lines */ + #define FULL_TIME 0 /* don't use crippled US date */ + /* instead use: yyyymmdd hhmmss */ + #include #include #include *************** *** 1325,1331 **** return res; } ! time_t now; /* * Log a message to the appropriate log files, users, etc. based on --- 1339,1346 ---- return res; } ! time_t now; ! struct tm *now_tm; /* * Log a message to the appropriate log files, users, etc. based on *************** *** 1342,1347 **** --- 1357,1365 ---- int fac, prilev, lognum; int msglen; char *timestamp; + #if FULL_TIME + char buf[16]; + #endif dprintf("logmsg: %s, flags %x, from %s, msg %s\n", textpri(pri), flags, from, msg); *************** *** 1365,1371 **** msg += 16; msglen -= 16; } ! /* extract facility and priority level */ if (flags & MARK) fac = LOG_NFACILITIES; --- 1383,1397 ---- msg += 16; msglen -= 16; } ! ! #if FULL_TIME ! now_tm = localtime(&now); ! sprintf(buf, "%.4d%.2d%.2d %.2d%.2d%.2d", ! now_tm->tm_year+1900, now_tm->tm_mon, now_tm->tm_mday, ! now_tm->tm_hour, now_tm->tm_min, now_tm->tm_sec); ! memcpy(timestamp, buf, 15); ! #endif ! /* extract facility and priority level */ if (flags & MARK) fac = LOG_NFACILITIES;