diff --git a/src/dird/dird.c b/src/dird/dird.c index 5d2b45eaa16..37464124e44 100644 --- a/src/dird/dird.c +++ b/src/dird/dird.c @@ -1003,8 +1003,8 @@ static bool check_resources() if (me->secure_erase_cmdline) { set_secure_erase_cmdline(me->secure_erase_cmdline); } - if (me->log_date_format) { - set_log_date_format(me->log_date_format); + if (me->log_timestamp_format) { + set_log_timestamp_format(me->log_timestamp_format); } } diff --git a/src/dird/dird_conf.c b/src/dird/dird_conf.c index 9ea541a08fa..35f861a2232 100644 --- a/src/dird/dird_conf.c +++ b/src/dird/dird_conf.c @@ -147,7 +147,7 @@ static RES_ITEM dir_items[] = { { "Auditing", CFG_TYPE_BOOL, ITEM(res_dir.auditing), 0, CFG_ITEM_DEFAULT, "false", "14.2.0-", NULL }, { "AuditEvents", CFG_TYPE_AUDIT, ITEM(res_dir.audit_events), 0, 0, NULL, "14.2.0-", NULL }, { "SecureEraseCommand", CFG_TYPE_STR, ITEM(res_dir.secure_erase_cmdline), 0, 0, NULL, "15.2.1-", NULL }, - { "LogDateFormat", CFG_TYPE_STR, ITEM(res_dir.log_date_format), 0, 0, NULL, NULL, NULL }, + { "LogTimestampFormat", CFG_TYPE_STR, ITEM(res_dir.log_timestamp_format), 0, 0, NULL, "15.2.3-", NULL }, { NULL, 0, { 0 }, 0, 0, NULL, NULL, NULL } }; @@ -2397,8 +2397,8 @@ void free_resource(RES *sres, int type) if (res->res_dir.secure_erase_cmdline) { free(res->res_dir.secure_erase_cmdline); } - if (res->res_dir.log_date_format) { - free(res->res_dir.log_date_format); + if (res->res_dir.log_timestamp_format) { + free(res->res_dir.log_timestamp_format); } break; case R_DEVICE: diff --git a/src/dird/dird_conf.h b/src/dird/dird_conf.h index 364165d92eb..3edbd27b91c 100644 --- a/src/dird/dird_conf.h +++ b/src/dird/dird_conf.h @@ -146,7 +146,7 @@ class DIRRES: public BRSRES { uint32_t stats_collect_interval; /* Statistics collect interval in seconds */ char *verid; /* Custom Id to print in version command */ char *secure_erase_cmdline; /* Cmdline to execute to perform secure erase of file */ - char *log_date_format; /* Date format to use in generic logging messages */ + char *log_timestamp_format; /* Timestamp format to use in generic logging messages */ s_password keyencrkey; /* Key Encryption Key */ }; diff --git a/src/filed/filed.c b/src/filed/filed.c index 4f127807829..379a4ff106f 100644 --- a/src/filed/filed.c +++ b/src/filed/filed.c @@ -603,8 +603,8 @@ static bool check_resources() if (me->secure_erase_cmdline) { set_secure_erase_cmdline(me->secure_erase_cmdline); } - if (me->log_date_format) { - set_log_date_format(me->log_date_format); + if (me->log_timestamp_format) { + set_log_timestamp_format(me->log_timestamp_format); } } diff --git a/src/filed/filed_conf.c b/src/filed/filed_conf.c index b3412447c68..fe6632edc01 100644 --- a/src/filed/filed_conf.c +++ b/src/filed/filed_conf.c @@ -122,7 +122,7 @@ static RES_ITEM cli_items[] = { { "AlwaysUseLmdb", CFG_TYPE_BOOL, ITEM(res_client.always_use_lmdb), 0, CFG_ITEM_DEFAULT, "false", NULL, NULL }, { "LmdbThreshold", CFG_TYPE_PINT32, ITEM(res_client.lmdb_threshold), 0, 0, NULL, NULL, NULL }, { "SecureEraseCommand", CFG_TYPE_STR, ITEM(res_client.secure_erase_cmdline), 0, 0, NULL, NULL, NULL }, - { "LogDateFormat", CFG_TYPE_STR, ITEM(res_client.log_date_format), 0, 0, NULL, NULL, NULL }, + { "LogTimestampFormat", CFG_TYPE_STR, ITEM(res_client.log_timestamp_format), 0, 0, NULL, "15.2.3-", NULL }, { NULL, 0, { 0 }, 0, 0, NULL, NULL, NULL } }; @@ -365,8 +365,8 @@ void free_resource(RES *sres, int type) if (res->res_client.secure_erase_cmdline) { free(res->res_client.secure_erase_cmdline); } - if (res->res_client.log_date_format) { - free(res->res_client.log_date_format); + if (res->res_client.log_timestamp_format) { + free(res->res_client.log_timestamp_format); } break; case R_MSGS: diff --git a/src/filed/filed_conf.h b/src/filed/filed_conf.h index bd61085c9b3..7ff309b6d74 100644 --- a/src/filed/filed_conf.h +++ b/src/filed/filed_conf.h @@ -117,7 +117,7 @@ class CLIENTRES : public BRSRES { TLS_CONTEXT *tls_ctx; /* Shared TLS Context */ char *verid; /* Custom Id to print in version command */ char *secure_erase_cmdline; /* Cmdline to execute to perform secure erase of file */ - char *log_date_format; /* Date format to use in generic logging messages */ + char *log_timestamp_format; /* Timestamp format to use in generic logging messages */ uint64_t max_bandwidth_per_job; /* Bandwidth limitation (global) */ }; diff --git a/src/lib/message.c b/src/lib/message.c index 1fb8261adf1..5e3ade92d3f 100644 --- a/src/lib/message.c +++ b/src/lib/message.c @@ -76,7 +76,7 @@ void setup_tsd_key(); static pthread_mutex_t fides_mutex = PTHREAD_MUTEX_INITIALIZER; static MSGSRES *daemon_msgs; /* Global messages */ static char *catalog_db = NULL; /* Database type */ -static const char *log_date_format = "%d-%b %H:%M"; +static const char *log_timestamp_format = "%d-%b %H:%M"; static void (*message_callback)(int type, char *msg) = NULL; static FILE *trace_fd = NULL; #if defined(HAVE_WIN32) @@ -145,13 +145,11 @@ static void delivery_error(const char *fmt,...) int i, len, maxlen; POOLMEM *pool_buf; char dt[MAX_TIME_LENGTH]; - int dtlen; pool_buf = get_pool_memory(PM_EMSG); - bstrftime(dt, sizeof(dt), time(NULL), log_date_format); + bstrftime(dt, sizeof(dt), time(NULL), log_timestamp_format); bstrncat(dt, " ", sizeof(dt)); - dtlen = strlen(dt); i = Mmsg(pool_buf, "%s Message delivery ERROR: ", dt); @@ -844,7 +842,6 @@ void dispatch_message(JCR *jcr, int type, utime_t mtime, char *msg) MSGSRES *msgs; BPIPE *bpipe; const char *mode; - bool dt_set = false; Dmsg2(850, "Enter dispatch_message type=%d msg=%s", type, msg); @@ -863,10 +860,9 @@ void dispatch_message(JCR *jcr, int type, utime_t mtime, char *msg) dtlen = 0; mtime = time(NULL); /* get time for SQL log */ } else { - bstrftime(dt, sizeof(dt), mtime, log_date_format); + bstrftime(dt, sizeof(dt), mtime, log_timestamp_format); bstrncat(dt, " ", sizeof(dt)); dtlen = strlen(dt); - dt_set = true; } /* @@ -1924,7 +1920,7 @@ void q_msg(const char *file, int line, JCR *jcr, int type, utime_t mtime, const /* * Set gobal date format used for log messages. */ -void set_log_date_format(const char *format) +void set_log_timestamp_format(const char *format) { - log_date_format = format; + log_timestamp_format = format; } diff --git a/src/lib/message.h b/src/lib/message.h index 2db41445f23..b1f03b58bc1 100644 --- a/src/lib/message.h +++ b/src/lib/message.h @@ -165,7 +165,7 @@ void Jmsg(JCR *jcr, int type, utime_t mtime, const char *fmt,...); void Qmsg(JCR *jcr, int type, utime_t mtime, const char *fmt,...); bool get_trace(void); const char *get_basename(const char *pathname); -void set_log_date_format(const char *format); +void set_log_timestamp_format(const char *format); typedef bool (*db_log_insert_func)(JCR *jcr, utime_t mtime, char *msg); extern DLL_IMP_EXP db_log_insert_func p_db_log_insert; diff --git a/src/stored/stored.c b/src/stored/stored.c index 5d082f198d0..6d8c5ab05ab 100644 --- a/src/stored/stored.c +++ b/src/stored/stored.c @@ -520,8 +520,8 @@ static int check_resources() if (me->secure_erase_cmdline) { set_secure_erase_cmdline(me->secure_erase_cmdline); } - if (me->log_date_format) { - set_log_date_format(me->log_date_format); + if (me->log_timestamp_format) { + set_log_timestamp_format(me->log_timestamp_format); } } diff --git a/src/stored/stored_conf.c b/src/stored/stored_conf.c index 68bac2c7104..cfe42cf004a 100644 --- a/src/stored/stored_conf.c +++ b/src/stored/stored_conf.c @@ -109,7 +109,7 @@ static RES_ITEM store_items[] = { { "DeviceReserveByMediaType", CFG_TYPE_BOOL, ITEM(res_store.device_reserve_by_mediatype), 0, CFG_ITEM_DEFAULT, "false", NULL, NULL }, { "FileDeviceConcurrentRead", CFG_TYPE_BOOL, ITEM(res_store.filedevice_concurrent_read), 0, CFG_ITEM_DEFAULT, "false", NULL, NULL }, { "SecureEraseCommand", CFG_TYPE_STR, ITEM(res_store.secure_erase_cmdline), 0, 0, NULL, NULL, NULL }, - { "LogDateFormat", CFG_TYPE_STR, ITEM(res_store.log_date_format), 0, 0, NULL, NULL, NULL }, + { "LogTimestampFormat", CFG_TYPE_STR, ITEM(res_store.log_timestamp_format), 0, 0, NULL, "15.2.3-", NULL }, { NULL, 0, { 0 }, 0, 0, NULL, NULL, NULL } }; @@ -636,8 +636,8 @@ void free_resource(RES *sres, int type) if (res->res_store.secure_erase_cmdline) { free(res->res_store.secure_erase_cmdline); } - if (res->res_store.log_date_format) { - free(res->res_store.log_date_format); + if (res->res_store.log_timestamp_format) { + free(res->res_store.log_timestamp_format); } break; case R_DEVICE: diff --git a/src/stored/stored_conf.h b/src/stored/stored_conf.h index 207d5996408..b7269c6115a 100644 --- a/src/stored/stored_conf.h +++ b/src/stored/stored_conf.h @@ -124,7 +124,7 @@ class STORES : public BRSRES { alist *tls_allowed_cns; /* TLS Allowed Clients */ char *verid; /* Custom Id to print in version command */ char *secure_erase_cmdline; /* Cmdline to execute to perform secure erase of file */ - char *log_date_format; /* Date format to use in generic logging messages */ + char *log_timestamp_format; /* Timestamp format to use in generic logging messages */ uint64_t max_bandwidth_per_job; /* Bandwidth limitation (global) */ TLS_CONTEXT *tls_ctx; /* Shared TLS Context */