Browse code

core: logging: JSON: CEE: add the @cee prefix in Syslog messages

Daniel Pocock authored on 09/09/2021 10:59:31 • Henning Westerholt committed on 09/09/2021 19:33:56
Showing 1 changed files
... ...
@@ -652,6 +652,10 @@ static void ksr_slog_json_str_escape(str *s_in, str *s_out, int *emode)
652 652
         "\"file\":{\"name\":\"%s\",\"line\":%d},\"native\":{\"function\":\"%s\"},\"msg\":\"%s\"," \
653 653
         "\"pname\":\"%s\",\"appname\":\"%s\",\"hostname\":\"%s\"}%s"
654 654
 
655
+#define KSR_SLOG_SYSLOG_JSON_CEEFMT "@cee: " KSR_SLOG_JSON_CEEFMT
656
+
657
+#define KSR_SLOG_STDERR_JSON_CEEFMT KSR_SLOG_JSON_CEEFMT
658
+
655 659
 void ksr_slog_json(ksr_logdata_t *kld, const char *format, ...)
656 660
 {
657 661
 	va_list arglist;
... ...
@@ -718,7 +722,7 @@ void ksr_slog_json(ksr_logdata_t *kld, const char *format, ...)
718 722
 	strftime (iso8601buf, ISO8601_BUF_SIZE, "%FT%T", &_tm);
719 723
 	if (unlikely(log_stderr)) {
720 724
 		if (unlikely(log_cee)) {
721
-			fprintf(stderr, KSR_SLOG_JSON_CEEFMT,
725
+			fprintf(stderr, KSR_SLOG_STDERR_JSON_CEEFMT,
722 726
 			iso8601buf, _tp.tv_nsec, my_pid(),
723 727
 #ifdef HAVE_PTHREAD
724 728
                         (uintmax_t)pthread_self(),
... ...
@@ -739,7 +743,7 @@ void ksr_slog_json(ksr_logdata_t *kld, const char *format, ...)
739 743
 		}
740 744
 	} else {
741 745
 		if (unlikely(log_cee)) {
742
-			_km_log_func(kld->v_facility, KSR_SLOG_JSON_CEEFMT,
746
+			_km_log_func(kld->v_facility, KSR_SLOG_SYSLOG_JSON_CEEFMT,
743 747
 			iso8601buf, _tp.tv_nsec, my_pid(),
744 748
 #ifdef HAVE_PTHREAD
745 749
                         pthread_self(),