Changeset 1779 for trunk/gsdl
- Timestamp:
- 2000-12-11T12:03:48+13:00 (24 years ago)
- Location:
- trunk/gsdl
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/etc/main.cfg
r1759 r1779 14 14 # turning off EmailEvents and EmailUserEvents will remove any 15 15 # reliance on MailServer. 16 #MailServer mail.cs.waikato.ac.nz16 #MailServer mail.cs.waikato.ac.nz 17 17 18 18 # Set status to "disabled" if you don't want the Maintenance and … … 33 33 usecookies false 34 34 35 # LogDateFormat sets the format that timestamps will be stored in the usage 36 # log (i.e. if logcgiargs is enabled). It takes the following values: 37 LocalTime: (the default) The local time and date in the form 38 "Thu Dec 7 23:47:00 NZDT 2000". 39 UTCTime: Coordinated universal time (GMT) in the same format as LocalTime. 40 Absolute: Integer value representing the number of seconds since 41 00:00:00 1/1/1970 GMT 42 LogDateFormat LocalTime 43 35 44 # Log any events that Greenstone deems important in 36 45 # $GSDLHOME/etc/events.txt. … … 42 51 # (e.g. someone just built a collection) 43 52 # Disabled: Don't log events 44 LogEvents AllEvents53 LogEvents Disabled 45 54 46 55 # Email the maintainer whenever any event occurs. EmailEvents … … 48 57 # Note that perl must be installed for EmailEvents or 49 58 # EmailUserEvents to work. 50 EmailEvents AllEvents59 EmailEvents Disabled 51 60 52 61 # In some cases it may be appropriate to email the user about a 53 62 # certain event (e.g. notification from the collector that a collection 54 63 # was built successfully) 55 EmailUserEvents true64 EmailUserEvents false 56 65 57 66 -
trunk/gsdl/lib/gsdltimes.cpp
r1778 r1779 117 117 } 118 118 119 // returns current date and time formatted like "Thu Dec 7 23:43:38 2000"119 // returns current date and time formatted like "Thu Dec 7 23:43:38 GMT 2000" 120 120 // if ltime is true return value will be expressed in local time, otherwise 121 121 // it'll be Coordinated Universal Time (UTC) … … 123 123 text_t get_date (bool ltime) { 124 124 125 char *timestr ;125 char *timestr = new char[128]; 126 126 tm *tm_ptr = NULL; 127 127 time_t t = time(NULL); … … 130 130 if (tm_ptr == NULL) return ""; 131 131 132 strftime (timestr, 128, "%a %b %e %T % Y", tm_ptr);132 strftime (timestr, 128, "%a %b %e %T %Z %Y", tm_ptr); 133 133 text_t ret = timestr; 134 delete timestr; 134 135 return ret; 135 136 } -
trunk/gsdl/src/recpt/receptionist.cpp
r1778 r1779 29 29 #include "htmlutils.h" 30 30 #include "gsdltools.h" 31 #include "gsdltimes.h" 31 32 #include "OIDtools.h" 32 33 #include <assert.h> … … 56 57 usecookies = false; 57 58 logcgiargs = false; 59 LogDateFormat = LocalTime; 58 60 59 61 maintainer.clear(); … … 214 216 else if (key == "maintainer") configinfo.maintainer = cfgline[0]; 215 217 else if (key == "MailServer") configinfo.MailServer = cfgline[0]; 218 else if (key == "LogDateFormat") { 219 if (cfgline[0] == "UTCTime") configinfo.LogDateFormat = UTCTime; 220 else if (cfgline[0] == "Absolute") configinfo.LogDateFormat = Absolute; 221 } 216 222 else if (key == "LogEvents") { 217 223 if (cfgline[0] == "CollectorEvents") configinfo.LogEvents = CollectorEvents; … … 595 601 if (host.empty()) host = gsdl_getenv ("REMOTE_ADDR", fcgienv); 596 602 text_t browser = gsdl_getenv ("HTTP_USER_AGENT", fcgienv); 597 time_t ttime = time(NULL);598 603 599 604 cgiargsclass::const_iterator args_here = args.begin(); … … 615 620 logstr += " " + host; 616 621 logstr += " ["; 617 logstr += ttime; 622 if (configinfo.LogDateFormat == UTCTime) { 623 logstr += get_date (false); 624 } else if (configinfo.LogDateFormat == Absolute) { 625 time_t ttime = time(NULL); 626 logstr += ttime; 627 } else { 628 // LocalTime 629 logstr += get_date (true); 630 } 618 631 logstr += "] (" + argstr + ") \""; 619 632 logstr += browser; -
trunk/gsdl/src/recpt/receptionist.h
r1762 r1779 63 63 64 64 enum events_t {Disabled, CollectorEvents, AllEvents}; 65 enum ldformat_t {LocalTime, UTCTime, Absolute}; 65 66 66 67 struct recptconf { … … 78 79 bool logcgiargs; // true if we want to log cgi arguments 79 80 81 ldformat_t LogDateFormat; 82 80 83 text_t maintainer; // email address of maintainer 81 84 text_t MailServer; // SMTP mail server to use when sending event messages by email
Note:
See TracChangeset
for help on using the changeset viewer.