]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Use floating point ts instead of microseconds log_json 4674/head
authorVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 30 Oct 2023 17:15:26 +0000 (17:15 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 30 Oct 2023 17:15:26 +0000 (17:15 +0000)
src/libserver/logger/logger.c

index 33117f72f5d72489797412188bcbe3ec89edd76f..e10dfd3926f3740fae6e10244583673080f310a2 100644 (file)
@@ -1094,7 +1094,7 @@ void rspamd_log_fill_iov(struct rspamd_logger_iov_ctx *iov_ctx,
                /* Perform JSON logging */
                guint slen = id ? strlen(id) : strlen("(NULL)");
                slen = MIN(RSPAMD_LOG_ID_LEN, slen);
-               r = rspamd_snprintf(tmpbuf, sizeof(tmpbuf), "{\"ts\": %L, "
+               r = rspamd_snprintf(tmpbuf, sizeof(tmpbuf), "{\"ts\": %f, "
                                                                                                        "\"pid\": %P, "
                                                                                                        "\"severity\": \"%s\", "
                                                                                                        "\"worker_type\": \"%s\", "
@@ -1102,7 +1102,7 @@ void rspamd_log_fill_iov(struct rspamd_logger_iov_ctx *iov_ctx,
                                                                                                        "\"module\": \"%s\", "
                                                                                                        "\"function\": \"%s\", "
                                                                                                        "\"message\": \"",
-                                                       (gint64) (ts * 1e6),
+                                                       ts,
                                                        logger->pid,
                                                        rspamd_get_log_severity_string(level_flags),
                                                        logger->process_type,