{ NULL, 0 }
};
+int log_dates_utc = 0;
+
+
/*
* Log the message to the logfile. Include the severity and
* a time stamp.
time_t timeval;
timeval = time(NULL);
- CTIME_R(&timeval, buffer + len, sizeof(buffer) - len - 1);
+#ifdef HAVE_GMTIME_R
+ if (log_dates_utc) {
+ struct tm utc;
+ gmtime_r(&timeval, &utc);
+ asctime_r(&utc, buffer + len);
+ } else
+#endif
+ CTIME_R(&timeval, buffer + len, sizeof(buffer) - len - 1);
s = strrchr(buffer, '\n');
if (s) {
s[1] = '\0';
}
- s = fr_int2str(levels, (lvl & ~L_CONS), ": ");
-
- strcat(buffer, s);
+ strcat(buffer, fr_int2str(levels, (lvl & ~L_CONS), ": "));
len = strlen(buffer);
}
struct main_config_t mainconfig;
char *request_log_file = NULL;
char *debug_condition = NULL;
+extern int log_dates_utc;
typedef struct cached_config_t {
struct cached_config_t *next;
{ "log", PW_TYPE_SUBSECTION, 0, NULL, (const void *) logdest_config },
{ "log_file", PW_TYPE_STRING_PTR, 0, &mainconfig.log_file, NULL },
{ "log_destination", PW_TYPE_STRING_PTR, 0, &radlog_dest, NULL },
+ { "use_utc", PW_TYPE_BOOLEAN, 0, &log_dates_utc, NULL },
{ NULL, -1, 0, NULL, NULL }
};
{ "msg_badpass", PW_TYPE_STRING_PTR, 0, &mainconfig.auth_badpass_msg, NULL},
{ "msg_goodpass", PW_TYPE_STRING_PTR, 0, &mainconfig.auth_goodpass_msg, NULL},
+ { "use_utc", PW_TYPE_BOOLEAN, 0, &log_dates_utc, NULL },
+
{ NULL, -1, 0, NULL, NULL }
};