The LogTime option seems to cause a constant stream of entries in the log
file with a timestamp, but no text and no newline. It appears that
LogTime doesn't work correctly without LogVerbose turned on...
Here's the fix I'm using - can we get it in the next version?
*** clamd/others.c_orig Tue Nov 19 11:37:14 2002
--- clamd/others.c Tue Nov 19 11:49:08 2002
***************
*** 78,92 ****
}
- if(logtime) {
- time(&currtime);
- pt = ctime(&currtime);
- timestr = mcalloc(strlen(pt), sizeof(char));
- strncpy(timestr, pt, strlen(pt) - 1);
- fprintf(fd, "%s -> ", timestr);
- free(timestr);
- }
-
if(logsize) {
if(stat(logfile, &sb) != -1) {
if(sb.st_size > logsize) {
--- 78,83 ----
***************
*** 102,107 ****
--- 93,110 ----
va_start(args, str);
+ /* Need to avoid logging time for verbose messages when logverbose
+ is not set or we get a bunch of timestamps in the log without
+ newlines... */
+ if(logtime && ((*str != '*') || logverbose)) {
+ time(&currtime);
+ pt = ctime(&currtime);
+ timestr = mcalloc(strlen(pt), sizeof(char));
+ strncpy(timestr, pt, strlen(pt) - 1);
+ fprintf(fd, "%s -> ", timestr);
+ free(timestr);
+ }
+
if(*str == '!') {
fprintf(fd, "ERROR: ");
vfprintf(fd, ++str, args);
Enjoy!
Ed
Ed Phillips <[EMAIL PROTECTED]> University of Delaware (302) 831-6082
Systems Programmer III, Network and Systems Services
finger -l [EMAIL PROTECTED] for PGP public key
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]